From 78445079e0fba7f87afdace4c4a7b793902ad6c0 Mon Sep 17 00:00:00 2001 From: isaacs Date: Thu, 9 May 2024 17:58:51 -0700 Subject: [PATCH] test: don't fail when node is in a different location --- tap-snapshots/test/build-esm.ts.test.cjs | 14 +++++++------- test/build-esm.ts | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tap-snapshots/test/build-esm.ts.test.cjs b/tap-snapshots/test/build-esm.ts.test.cjs index d1ba92f..50469c2 100644 --- a/tap-snapshots/test/build-esm.ts.test.cjs +++ b/tap-snapshots/test/build-esm.ts.test.cjs @@ -22,7 +22,7 @@ Array [ exports[`test/build-esm.ts > TAP > basic esm build > must match snapshot 2`] = ` Array [ Array [ - "/usr/local/bin/node", + "{NODE}", Array [ "{CWD}/node_modules/typescript/bin/tsc", "-p", @@ -33,7 +33,7 @@ Array [ }, ], Array [ - "/usr/local/bin/node", + "{NODE}", Array [ "{CWD}/node_modules/typescript/bin/tsc", "-p", @@ -44,7 +44,7 @@ Array [ }, ], Array [ - "/usr/local/bin/node", + "{NODE}", Array [ "{CWD}/node_modules/typescript/bin/tsc", "-p", @@ -73,7 +73,7 @@ Array [ exports[`test/build-esm.ts > TAP > build failure > must match snapshot 2`] = ` Array [ Array [ - "/usr/local/bin/node", + "{NODE}", Array [ "{CWD}/node_modules/typescript/bin/tsc", "-p", @@ -84,7 +84,7 @@ Array [ }, ], Array [ - "/usr/local/bin/node", + "{NODE}", Array [ "{CWD}/node_modules/typescript/bin/tsc", "-p", @@ -95,7 +95,7 @@ Array [ }, ], Array [ - "/usr/local/bin/node", + "{NODE}", Array [ "{CWD}/node_modules/typescript/bin/tsc", "-p", @@ -106,7 +106,7 @@ Array [ }, ], Array [ - "/usr/local/bin/node", + "{NODE}", Array [ "{CWD}/node_modules/typescript/bin/tsc", "-p", diff --git a/test/build-esm.ts b/test/build-esm.ts index 44f391c..d5a5bc6 100644 --- a/test/build-esm.ts +++ b/test/build-esm.ts @@ -5,6 +5,8 @@ import t from 'tap' const cwd = process.cwd() t.afterEach(() => process.chdir(cwd)) +t.cleanSnapshot = s => s.split(process.execPath).join('{NODE}') + const spawnSuccess: SpawnSyncReturns = { status: 0, signal: null,