From d6fe43eeaf45fa5992c2288a0bd40d7cd05fef17 Mon Sep 17 00:00:00 2001 From: dfahlander Date: Tue, 12 Jan 2021 23:25:27 +0100 Subject: [PATCH] Corrected test for BulkError --- test/tests-table.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/tests-table.js b/test/tests-table.js index a205ed4aa..375e00fb7 100644 --- a/test/tests-table.js +++ b/test/tests-table.js @@ -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"); } });