From c5a8f7ebea8d80887706477ad99ad9c899ad4770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wieland=20Sch=C3=B6bl?= Date: Wed, 25 Aug 2021 10:25:34 +0000 Subject: [PATCH] test: improve easy-ast test performance --- test/easy-ast.spec.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/easy-ast.spec.ts b/test/easy-ast.spec.ts index 345f5453..26a43468 100644 --- a/test/easy-ast.spec.ts +++ b/test/easy-ast.spec.ts @@ -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);