mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-19 08:02:55 +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';
|
||||
|
||||
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'))) {
|
||||
try {
|
||||
const test = (await import(file))['testConfig'] as EasyAstSpecType;
|
||||
|
||||
it(test.testName, () => {
|
||||
const project = omitBy(lightweightProjectFromPath(file, true)[toUnixPath(file)], (_value, key) =>
|
||||
key.startsWith('$'),
|
||||
expect(omitBy(project[toUnixPath(file)], (_value, key) => key.startsWith('$'))).to.be.deep.equal(
|
||||
test.expected,
|
||||
);
|
||||
|
||||
expect(project).to.be.deep.equal(test.expected);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
Reference in New Issue
Block a user