summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-19 18:46:27 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-19 18:46:27 -0500
commit7901a467217f311566e7a3bc83ceafa17909d511 (patch)
tree330b16bb3cefdffc282f13e831d9c924498184ee
parenta31ac6857430ed7bea1e1500ef5643caca9b4347 (diff)
Validate results of importDictionary
-rw-r--r--test/test-database.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/test/test-database.js b/test/test-database.js
index b9ac8a46..d66e2137 100644
--- a/test/test-database.js
+++ b/test/test-database.js
@@ -83,26 +83,30 @@ async function testDatabase1() {
await database.prepare();
for (const {cleanup} of iterations) {
+ const expectedSummary = {
+ title,
+ revision: 'test',
+ sequenced: true,
+ version: 3,
+ prefixWildcardsSupported: true
+ };
+
// Import data
let progressEvent = false;
- await database.importDictionary(
+ const {result, errors} = await database.importDictionary(
testDictionarySource,
() => {
progressEvent = true;
},
{prefixWildcardsSupported: true}
);
+ assert.deepStrictEqual(errors, []);
+ assert.deepStrictEqual(result, expectedSummary);
assert.ok(progressEvent);
// Get info summary
const info = await database.getDictionaryInfo();
- assert.deepStrictEqual(info, [{
- title,
- revision: 'test',
- sequenced: true,
- version: 3,
- prefixWildcardsSupported: true
- }]);
+ assert.deepStrictEqual(info, [expectedSummary]);
// Get counts
const counts = await database.getDictionaryCounts(