Skip to content

Commit

Permalink
Add tests for SQLJSPackageDB (#33)
Browse files Browse the repository at this point in the history
* Add tests for SQLJSPackageDB

Test the save, find, stats, and clear class methods. No tests are added
for the logging methods.

Minor styling changes in some other files, as applied by prettier.

* Make test for SQLJSPackageDB.findResourceInfo stricter

Check properties of the returned resource to make sure it matches one of
the expected results.

Remove unneeded comment from saveResourceInfo test.

* Expect last added resource from findResourceInfo
  • Loading branch information
mint-thompson authored Aug 22, 2024
1 parent efcd580 commit efa241a
Show file tree
Hide file tree
Showing 2 changed files with 594 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/db/SQLJSPackageDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ export class SQLJSPackageDB implements PackageDB {
if (result.sdCharacteristics) {
result.sdCharacteristics = JSON.parse(result.sdCharacteristics);
}
if (result.sdAbstract != null) {
result.sdAbstract = result.sdAbstract ? true : false;
}
results.push(result as ResourceInfo);
}
stmt.free();
Expand Down
Loading

0 comments on commit efa241a

Please sign in to comment.