aboutsummaryrefslogtreecommitdiff
path: root/test/test-database.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-07-31 10:53:35 -0400
committerGitHub <noreply@github.com>2021-07-31 10:53:35 -0400
commit2d57d69b9ed3adf1241074f7eb29a588bec817a2 (patch)
tree0c2b842d80dbb3324cef2f45fca5babe1eeb4014 /test/test-database.js
parentb99850ed54ecaa903a4bd1c2bcf3ae1cd405a3ed (diff)
Improve dictionary importer (#1859)
* Optimize dictionary data parsing during import * Use ArrayBuffer instead of string * Add missing function for testing
Diffstat (limited to 'test/test-database.js')
-rw-r--r--test/test-database.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/test-database.js b/test/test-database.js
index f2a7efdd..19ac49e2 100644
--- a/test/test-database.js
+++ b/test/test-database.js
@@ -86,7 +86,7 @@ function clearDatabase(timeout) {
async function testDatabase1() {
// Load dictionary data
const testDictionary = createTestDictionaryArchive('valid-dictionary1');
- const testDictionarySource = await testDictionary.generateAsync({type: 'string'});
+ const testDictionarySource = await testDictionary.generateAsync({type: 'arraybuffer'});
const testDictionaryIndex = JSON.parse(await testDictionary.files['index.json'].async('string'));
const title = testDictionaryIndex.title;
@@ -766,7 +766,7 @@ async function testFindTagForTitle1(database, title) {
async function testDatabase2() {
// Load dictionary data
const testDictionary = createTestDictionaryArchive('valid-dictionary1');
- const testDictionarySource = await testDictionary.generateAsync({type: 'string'});
+ const testDictionarySource = await testDictionary.generateAsync({type: 'arraybuffer'});
const testDictionaryIndex = JSON.parse(await testDictionary.files['index.json'].async('string'));
const title = testDictionaryIndex.title;
@@ -823,7 +823,7 @@ async function testDatabase3() {
for (const invalidDictionary of invalidDictionaries) {
const testDictionary = createTestDictionaryArchive(invalidDictionary);
- const testDictionarySource = await testDictionary.generateAsync({type: 'string'});
+ const testDictionarySource = await testDictionary.generateAsync({type: 'arraybuffer'});
let error = null;
try {