diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-07-17 22:39:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-17 22:39:25 -0400 |
commit | e1230c7934084e1748e70e88b98f67e05cf0cf11 (patch) | |
tree | e551d98827ee1977538d6b5fd402050459718361 /test | |
parent | fafa746a632b1907d9cca262f689d7bec4e0f940 (diff) |
CSS JSON styles generalization (#1838)
* Rename files
* Generalize custom CSS generation and testing
* Add CSS JSON file for display pronunciation
Diffstat (limited to 'test')
-rw-r--r-- | test/test-css-json.js (renamed from test/test-structured-content-style.js) | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/test/test-structured-content-style.js b/test/test-css-json.js index ed8c24e9..541411d9 100644 --- a/test/test-structured-content-style.js +++ b/test/test-css-json.js @@ -18,15 +18,19 @@ const fs = require('fs'); const assert = require('assert'); const {testMain} = require('../dev/util'); -const {generateRulesJson, getOutputPath} = require('../dev/generate-structured-content-style'); +const {formatRulesJson, generateRules} = require('../dev/css-to-json-util'); +const {getTargets} = require('../dev/generate-css-json'); function main() { - const outputPath = getOutputPath(); - const actual = fs.readFileSync(outputPath, {encoding: 'utf8'}); - const expected = generateRulesJson(); - assert.deepStrictEqual(actual, expected); + for (const {cssFile, overridesCssFile, outputPath} of getTargets()) { + const actual = fs.readFileSync(outputPath, {encoding: 'utf8'}); + const expected = formatRulesJson(generateRules(cssFile, overridesCssFile)); + assert.deepStrictEqual(actual, expected); + } } -if (require.main === module) { testMain(main); } +if (require.main === module) { + testMain(main, process.argv.slice(2)); +} |