mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 01:22:54 +00:00
test: improve easy-ast test performance
This commit is contained in:
@@ -19,16 +19,15 @@ import {expect} from 'chai';
|
|||||||
import {omitBy} from 'lodash';
|
import {omitBy} from 'lodash';
|
||||||
|
|
||||||
describe('Easy AST', async () => {
|
describe('Easy AST', async () => {
|
||||||
|
const project = lightweightProjectFromPath('./test/easy-ast', true);
|
||||||
for (const file of expandPathToFilesSync('./test/easy-ast', file => file.endsWith('ast-test.ts'))) {
|
for (const file of expandPathToFilesSync('./test/easy-ast', file => file.endsWith('ast-test.ts'))) {
|
||||||
try {
|
try {
|
||||||
const test = (await import(file))['testConfig'] as EasyAstSpecType;
|
const test = (await import(file))['testConfig'] as EasyAstSpecType;
|
||||||
|
|
||||||
it(test.testName, () => {
|
it(test.testName, () => {
|
||||||
const project = omitBy(lightweightProjectFromPath(file, true)[toUnixPath(file)], (_value, key) =>
|
expect(omitBy(project[toUnixPath(file)], (_value, key) => key.startsWith('$'))).to.be.deep.equal(
|
||||||
key.startsWith('$'),
|
test.expected,
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(project).to.be.deep.equal(test.expected);
|
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|||||||
Reference in New Issue
Block a user