From f5ef62d5838f9ec004fb8fbc68d382a58b5c4c35 Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Sun, 13 Oct 2024 22:33:11 +0200 Subject: [PATCH] Install current Preflight globally before testing --- __tests__/e2e.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/__tests__/e2e.test.ts b/__tests__/e2e.test.ts index d85d9145..7f2df177 100644 --- a/__tests__/e2e.test.ts +++ b/__tests__/e2e.test.ts @@ -6,6 +6,7 @@ const fixturesTempDir = '__tests__/fixtures/__temp'; beforeAll( async () => { + await execa`pnpm add --global .`; await pMap( [ { @@ -60,7 +61,7 @@ function sortStdoutAndStripVersionNumber(stdout: string) { test('Passes in the react-passing test project', async () => { const { stdout, stderr } = await execa({ cwd: `${fixturesTempDir}/react-passing`, - })`${process.cwd()}/bin/preflight.ts`; + })`preflight`; expect(sortStdoutAndStripVersionNumber(stdout)).toMatchSnapshot(); expect(stderr.replace(/^\(node:\d+\) /, '')).toMatchSnapshot(); @@ -69,7 +70,7 @@ test('Passes in the react-passing test project', async () => { test('Passes in the next-js-passing test project', async () => { const { stdout, stderr } = await execa({ cwd: `${fixturesTempDir}/next-js-passing`, - })`${process.cwd()}/bin/preflight.ts`; + })`preflight`; expect(sortStdoutAndStripVersionNumber(stdout)).toMatchSnapshot(); expect(stderr.replace(/^\(node:\d+\) /, '')).toMatchSnapshot();