From 6726d1ee472fe4ab1264df30c795bc4a22b90877 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Sat, 28 Jan 2023 11:58:48 -0800 Subject: [PATCH] Ensure PATH env matches CI locally --- test/lib/next-modes/base.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/lib/next-modes/base.ts b/test/lib/next-modes/base.ts index 714969ff46311..800205906fc21 100644 --- a/test/lib/next-modes/base.ts +++ b/test/lib/next-modes/base.ts @@ -65,6 +65,17 @@ export class NextInstance { constructor(opts: NextInstanceOpts) { Object.assign(this, opts) + + this.env = { + ...this.env, + // remove node_modules/.bin repo path from env + // to match CI $PATH value and isolate further + PATH: process.env.PATH.split(path.delimiter) + .filter((part) => { + return !part.includes(path.join('node_modules', '.bin')) + }) + .join(path.delimiter), + } } protected async writeInitialFiles() {