From a9230f289f36569d02b188774865d5bf80013218 Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Tue, 3 Oct 2023 13:18:12 -0400 Subject: [PATCH] chore(js): re-enable skipped test (#19427) --- e2e/esbuild/src/esbuild.test.ts | 8 +++++-- e2e/js/src/js-executor-tsc.test.ts | 35 +++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/e2e/esbuild/src/esbuild.test.ts b/e2e/esbuild/src/esbuild.test.ts index c25e9302a5b11..56af4ccb9361a 100644 --- a/e2e/esbuild/src/esbuild.test.ts +++ b/e2e/esbuild/src/esbuild.test.ts @@ -106,8 +106,12 @@ describe('EsBuild Plugin', () => { readFile(`dist/libs/${myPkg}/assets/a.md`).includes('initial a'); updateFile(`libs/${myPkg}/assets/a.md`, 'updated a'); await expect( - waitUntil(() => - readFile(`dist/libs/${myPkg}/assets/a.md`).includes('updated a') + waitUntil( + () => readFile(`dist/libs/${myPkg}/assets/a.md`).includes('updated a'), + { + timeout: 20_000, + ms: 500, + } ) ).resolves.not.toThrow(); watchProcess.kill(); diff --git a/e2e/js/src/js-executor-tsc.test.ts b/e2e/js/src/js-executor-tsc.test.ts index 2d49a40234966..b0ee877877605 100644 --- a/e2e/js/src/js-executor-tsc.test.ts +++ b/e2e/js/src/js-executor-tsc.test.ts @@ -27,8 +27,7 @@ describe('js:tsc executor', () => { beforeAll(() => (scope = newProject())); afterAll(() => cleanupProject()); - // TODO: Re-enable this when it is passing again - xit('should create libs with js executors (--compiler=tsc)', async () => { + it('should create libs with js executors (--compiler=tsc)', async () => { const lib = uniq('lib'); runCLI(`generate @nx/js:lib ${lib} --bundler=tsc --no-interactive`); const libPackageJson = readJson(`libs/${lib}/package.json`); @@ -71,20 +70,36 @@ describe('js:tsc executor', () => { }); updateFile(`libs/${lib}/docs/a/b/nested.md`, 'Nested File'); await expect( - waitUntil(() => - readFile(`dist/libs/${lib}/README.md`).includes(`Hello, World!`) + waitUntil( + () => readFile(`dist/libs/${lib}/README.md`).includes(`Hello, World!`), + { + timeout: 20_000, + ms: 500, + } ) ).resolves.not.toThrow(); await expect( - waitUntil(() => - readFile(`dist/libs/${lib}/docs/a/b/nested.md`).includes(`Nested File`) + waitUntil( + () => + readFile(`dist/libs/${lib}/docs/a/b/nested.md`).includes( + `Nested File` + ), + { + timeout: 20_000, + ms: 500, + } ) ).resolves.not.toThrow(); await expect( - waitUntil(() => - readFile(`dist/libs/${lib}/package.json`).includes( - `"version": "999.9.9"` - ) + waitUntil( + () => + readFile(`dist/libs/${lib}/package.json`).includes( + `"version": "999.9.9"` + ), + { + timeout: 20_000, + ms: 500, + } ) ).resolves.not.toThrow(); libBuildProcess.kill();