aboutsummaryrefslogtreecommitdiff
path: root/test/database.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/database.test.js')
-rw-r--r--test/database.test.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/database.test.js b/test/database.test.js
index 2fdea99c..702de9f8 100644
--- a/test/database.test.js
+++ b/test/database.test.js
@@ -20,6 +20,7 @@ import {IDBFactory, IDBKeyRange} from 'fake-indexeddb';
import {fileURLToPath} from 'node:url';
import path from 'path';
import {beforeEach, describe, expect, test, vi} from 'vitest';
+import {parseJson} from '../dev/json.js';
import {createDictionaryArchive} from '../dev/util.js';
import {DictionaryDatabase} from '../ext/js/language/dictionary-database.js';
import {DictionaryImporter} from '../ext/js/language/dictionary-importer.js';
@@ -109,7 +110,8 @@ async function testDatabase1() {
// Load dictionary data
const testDictionary = createTestDictionaryArchive('valid-dictionary1');
const testDictionarySource = await testDictionary.generateAsync({type: 'arraybuffer'});
- const testDictionaryIndex = JSON.parse(await testDictionary.files['index.json'].async('string'));
+ /** @type {import('dictionary-data').Index} */
+ const testDictionaryIndex = parseJson(await testDictionary.files['index.json'].async('string'));
const title = testDictionaryIndex.title;
const titles = new Map([
@@ -852,7 +854,8 @@ async function testDatabase2() {
// Load dictionary data
const testDictionary = createTestDictionaryArchive('valid-dictionary1');
const testDictionarySource = await testDictionary.generateAsync({type: 'arraybuffer'});
- const testDictionaryIndex = JSON.parse(await testDictionary.files['index.json'].async('string'));
+ /** @type {import('dictionary-data').Index} */
+ const testDictionaryIndex = parseJson(await testDictionary.files['index.json'].async('string'));
const title = testDictionaryIndex.title;
const titles = new Map([