Skip to content

Commit

Permalink
Repro of 1154
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander committed Oct 23, 2020
1 parent 203797f commit 5575009
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/tests-whereclause.js
Original file line number Diff line number Diff line change
Expand Up @@ -843,3 +843,21 @@ promisedTest("Virtual Index", async () => {
], null, 2), "equalsIgnoreCase() should work with virtual indexes");
//equal(daves.length, 3, "There should be 3 davids in the result when using equalsIgnoreCase()");
});

promisedTest("WhereClause.equals(invalid key)", async () => {
await db.files.where("filename").equals(null).first().then(()=>{
ok(false, "db.files.where('filename').equals(null) must fail but it didnt!");
}).catch(error => {
ok(true, `db.files.where('filename').equals(null) failed as expected (with ${error})`);
});
await db.files.where("filename").equals(undefined).first().then(()=>{
ok(false, "db.files.where('filename').equals(undefined) must fail but it didnt!");
}).catch(error => {
ok(true, `db.files.where('filename').equals(undefined) failed as expected (with ${error})`);
});
await db.files.where("filename").equals(function(){}).first().then(()=>{
ok(false, "db.files.where('filename').equals(function(){}) must fail but it didnt!");
}).catch(error => {
ok(true, `db.files.where('filename').equals(function(){}) failed as expected (with ${error})`);
});
});

0 comments on commit 5575009

Please sign in to comment.