From 06480751a9d9ff1471455f31e3efc99d552a4975 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 17 Feb 2020 22:31:28 -0500 Subject: Create yomichan-test script to reduce repeated code --- test/dictionary-validate.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'test/dictionary-validate.js') diff --git a/test/dictionary-validate.js b/test/dictionary-validate.js index dca3bcf5..082f0aea 100644 --- a/test/dictionary-validate.js +++ b/test/dictionary-validate.js @@ -1,13 +1,9 @@ const fs = require('fs'); const path = require('path'); +const yomichanTest = require('./yomichan-test'); -process.noDeprecation = true; // Suppress a warning about JSZip -const JSZip = require(path.join(__dirname, '../ext/mixed/lib/jszip.min.js')); -process.noDeprecation = false; - -const jsonSchemaFileName = path.join(__dirname, '../ext/bg/js/json-schema.js'); -const jsonSchemaFileSource = fs.readFileSync(jsonSchemaFileName, {encoding: 'utf8'}); -const JsonSchema = Function(`'use strict';${jsonSchemaFileSource};return JsonSchema;`)(); +const JSZip = yomichanTest.JSZip; +const {JsonSchema} = yomichanTest.requireScript('ext/bg/js/json-schema.js', ['JsonSchema']); function readSchema(relativeFileName) { -- cgit v1.2.3