diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-02-27 07:14:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-27 12:14:20 +0000 |
commit | c4fea2251606fb0b3d0d761a544dac578f3d9048 (patch) | |
tree | 3dbd85877f0d7b3d9de78ace7809e809a7a212d4 /test/fixtures/translator-test.js | |
parent | 2e9ea19207a7410f929bb908759d48cb2340f29c (diff) |
Update to zip.js for tests (#698)
* Use zip.js
* Set compression level to 0
* Update comments
Diffstat (limited to 'test/fixtures/translator-test.js')
-rw-r--r-- | test/fixtures/translator-test.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/fixtures/translator-test.js b/test/fixtures/translator-test.js index 95218830..ff3782a7 100644 --- a/test/fixtures/translator-test.js +++ b/test/fixtures/translator-test.js @@ -21,8 +21,8 @@ import {readFileSync} from 'fs'; import {fileURLToPath} from 'node:url'; import {dirname, join} from 'path'; import {expect, vi} from 'vitest'; +import {createDictionaryArchiveData} from '../../dev/dictionary-archive-util.js'; import {parseJson} from '../../dev/json.js'; -import {createDictionaryArchive} from '../../dev/util.js'; import {DictionaryDatabase} from '../../ext/js/dictionary/dictionary-database.js'; import {DictionaryImporter} from '../../ext/js/dictionary/dictionary-importer.js'; import {Translator} from '../../ext/js/language/translator.js'; @@ -45,8 +45,7 @@ vi.stubGlobal('chrome', chrome); */ export async function createTranslatorContext(dictionaryDirectory, dictionaryName) { // Dictionary - const testDictionary = createDictionaryArchive(dictionaryDirectory, dictionaryName); - const testDictionaryContent = await testDictionary.generateAsync({type: 'arraybuffer'}); + const testDictionaryData = await createDictionaryArchiveData(dictionaryDirectory, dictionaryName); // Setup database const dictionaryImporterMediaLoader = new DictionaryImporterMediaLoader(); @@ -56,7 +55,7 @@ export async function createTranslatorContext(dictionaryDirectory, dictionaryNam const {errors} = await dictionaryImporter.importDictionary( dictionaryDatabase, - testDictionaryContent, + testDictionaryData, {prefixWildcardsSupported: true} ); |