From a54f44122a3a245c1b1579c15b2faf9d50c15c55 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 22 Feb 2020 12:58:33 -0500 Subject: Update location of test dictionary data --- test/yomichan-test.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'test/yomichan-test.js') diff --git a/test/yomichan-test.js b/test/yomichan-test.js index dd4da919..939e0ad2 100644 --- a/test/yomichan-test.js +++ b/test/yomichan-test.js @@ -26,21 +26,14 @@ function getJSZip() { return JSZip; } -function createTestDictionaryArchive(dictionaryName) { - const fileNames = [ - 'index.json', - 'tag_bank_1.json', - 'tag_bank_2.json', - 'term_bank_1.json', - 'kanji_bank_1.json', - 'term_meta_bank_1.json', - 'kanji_meta_bank_1.json' - ]; +function createTestDictionaryArchive(dictionary, dictionaryName) { + const dictionaryDirectory = path.join(__dirname, 'data', 'dictionaries', dictionary); + const fileNames = fs.readdirSync(dictionaryDirectory); const archive = new (getJSZip())(); for (const fileName of fileNames) { - const source = fs.readFileSync(path.join(__dirname, 'test-dictionary-data', fileName), {encoding: 'utf8'}); + const source = fs.readFileSync(path.join(dictionaryDirectory, fileName), {encoding: 'utf8'}); const json = JSON.parse(source); if (fileName === 'index.json' && typeof dictionaryName === 'string') { json.title = dictionaryName; -- cgit v1.2.3