aboutsummaryrefslogtreecommitdiff
path: root/test/yomichan-test.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-22 12:58:33 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-22 12:58:33 -0500
commita54f44122a3a245c1b1579c15b2faf9d50c15c55 (patch)
treefb701bca745170f76a82e445182ec85f619c8ca5 /test/yomichan-test.js
parent4daf3435c24592352261c1186626abdc86beefb4 (diff)
Update location of test dictionary data
Diffstat (limited to 'test/yomichan-test.js')
-rw-r--r--test/yomichan-test.js15
1 files changed, 4 insertions, 11 deletions
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;