Skip to content

Commit

Permalink
Corrected test for BulkError
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander committed Jan 12, 2021
1 parent 3ddfd98 commit d6fe43e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/tests-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -945,8 +945,13 @@ promisedTest("bulkError by pos", async () => {
]);
ok(false, "Should not succeed");
} catch (bulkError) {
equal(bulkError.failures.length === 1, "Got one failure");
ok(bulkError instanceof Dexie.BulkError, "Got BulkError");
equal(bulkError.failures.length, 1, "Got one failure");
ok(bulkError.failures[0] instanceof Error, "failures[0] instanceof Error");
ok(bulkError.failures[1] === undefined, "failures[1] is undefined");
equal(Object.keys(bulkError.failuresByPos).length, 1, "Got one key in failuresByPos");
equal(Object.keys(bulkError.failuresByPos)[0], 1, "Failure in position 1");
ok(bulkError.failuresByPos[0] === undefined, "failuresByPos[0] is undefined");
ok(bulkError.failuresByPos[1] instanceof Error, "failuresByPos[1] instanceof Error");
}
});

0 comments on commit d6fe43e

Please sign in to comment.