Skip to content

Commit

Permalink
Test for new error throwing behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom committed Jan 21, 2021
1 parent c19feba commit 9874644
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/CRUD.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ describe("StormDB", function() {
new StormDB(engine);
});

describe(".value()", function() {
it("should throw error on non-existant data", function() {
const engine = new StormDB.localFileEngine(exampleDBPath);
const db = new StormDB(engine);

assert.throws(() =>
db
.get("random123")
.get("random123")
.value()
);
});
});

describe(".get()", function() {
it("should successfully get values from database", function() {
const engine = new StormDB.localFileEngine(exampleDBPath);
Expand Down

0 comments on commit 9874644

Please sign in to comment.