diff options
Diffstat (limited to 'test/test-database.js')
-rw-r--r-- | test/test-database.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test-database.js b/test/test-database.js index df152e57..dce89559 100644 --- a/test/test-database.js +++ b/test/test-database.js @@ -19,9 +19,8 @@ const fs = require('fs'); const url = require('url'); const path = require('path'); const assert = require('assert'); -const {JSZip} = require('../dev/yomichan-util'); -const {createTestDictionaryArchive} = require('./yomichan-test'); -const {VM} = require('./yomichan-vm'); +const {JSZip, createDictionaryArchive} = require('../dev/util'); +const {VM} = require('../dev/vm'); require('fake-indexeddb/auto'); const chrome = { @@ -125,6 +124,12 @@ const DictionaryImporter = vm.get('DictionaryImporter'); const DictionaryDatabase = vm.get('DictionaryDatabase'); +function createTestDictionaryArchive(dictionary, dictionaryName) { + const dictionaryDirectory = path.join(__dirname, 'data', 'dictionaries', dictionary); + return createDictionaryArchive(dictionaryDirectory, dictionaryName); +} + + function countTermsWithExpression(terms, expression) { return terms.reduce((i, v) => (i + (v.expression === expression ? 1 : 0)), 0); } |