spiegel-keyman/developer/src/kmc-ldml/test/test-testdata-e2e.ts
Marc Durdin 8bfd4c0bae chore(developer): refactor LdmlCompilerOptions
LdmlCompilerOptions is now based on the shared CompilerOptions. Also
fixes command line parameter inheritance for sub-commands.
2023-06-10 14:27:40 +07:00

24 lines
863 B
TypeScript

import { readFileSync } from 'fs';
import 'mocha';
import {assert} from 'chai';
import {compilerTestOptions, loadTestdata, makePathToFixture} from './helpers/index.js';
describe('testdata-tests', function() {
this.slow(500); // 0.5 sec -- json schema validation takes a while
it('should-build-testdata-fixtures', async function() {
// Let's build test-fr.json
// It should match test-fr.json (built from test-fr.xml)
const inputFilename = makePathToFixture('test-fr.xml');
const jsonFilename = makePathToFixture('test-fr.json');
// Compile the keyboard
const testData = loadTestdata(inputFilename, {...compilerTestOptions, saveDebug: true, shouldAddCompilerVersion: false});
assert.isNotNull(testData);
const jsonData = JSON.parse(readFileSync(jsonFilename, 'utf-8'));
assert.deepEqual(testData, jsonData);
});
});