Validate results of importDictionary

This commit is contained in:
toasted-nutbread 2020-02-19 18:46:27 -05:00
parent a31ac68574
commit 7901a46721

View File

@ -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(