diff --git a/__tests__/e2e.test.ts b/__tests__/e2e.test.ts index 81d327d4..7a096748 100644 --- a/__tests__/e2e.test.ts +++ b/__tests__/e2e.test.ts @@ -7,7 +7,14 @@ const fixturesTempDir = '__tests__/fixtures/__temp'; beforeAll( async () => { // Pack and install Preflight globally - const { stdout: pnpmPackTarballPath } = await execa`pnpm pack`; + const pnpmPackTarballPath = (await execa`pnpm pack`).stdout + .split('\n') + .find((line) => line.match(/^preflight-.*\.tgz$/)); + + if (!pnpmPackTarballPath) { + throw new Error('Failed to find the tarball path in `pnpm pack` output'); + } + await execa`pnpm add --global ${process.cwd()}/${pnpmPackTarballPath}`; await pMap(