From c496c8b60dabbc3d20cd4a8cb5165397970599c6 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Sat, 20 Nov 2021 04:38:20 +0200 Subject: [PATCH] test(core): fix hanging test --- packages/core/test/install/lifecycleScripts.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/core/test/install/lifecycleScripts.ts b/packages/core/test/install/lifecycleScripts.ts index b0977e1858..56fb3fc031 100644 --- a/packages/core/test/install/lifecycleScripts.ts +++ b/packages/core/test/install/lifecycleScripts.ts @@ -261,13 +261,15 @@ testOnNonWindows('lifecycle scripts have access to node-gyp', async () => { // `npm test` adds node-gyp to the PATH // it is removed here to test that pnpm adds it - const initialPath = process.env.PATH + const initialPath = process.env[PATH] if (typeof initialPath !== 'string') throw new Error('PATH is not defined') process.env[PATH] = initialPath .split(path.delimiter) - .filter((p: string) => !p.includes('node-gyp-bin') && !p.includes('npm')) + .filter((p: string) => !p.includes('node-gyp-bin') && + !p.includes(`${path.sep}npm${path.sep}`) && + !p.includes(`${path.sep}.npm${path.sep}`)) .join(path.delimiter) await addDependenciesToPackage({}, ['drivelist@5.1.8'], await testDefaults({ fastUnpack: false }))