Skip to content

Commit

Permalink
test: don't fail when node is in a different location
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed May 10, 2024
1 parent d012c74 commit 7844507
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tap-snapshots/test/build-esm.ts.test.cjs
Expand Up @@ -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",
Expand All @@ -33,7 +33,7 @@ Array [
},
],
Array [
"/usr/local/bin/node",
"{NODE}",
Array [
"{CWD}/node_modules/typescript/bin/tsc",
"-p",
Expand All @@ -44,7 +44,7 @@ Array [
},
],
Array [
"/usr/local/bin/node",
"{NODE}",
Array [
"{CWD}/node_modules/typescript/bin/tsc",
"-p",
Expand Down Expand Up @@ -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",
Expand All @@ -84,7 +84,7 @@ Array [
},
],
Array [
"/usr/local/bin/node",
"{NODE}",
Array [
"{CWD}/node_modules/typescript/bin/tsc",
"-p",
Expand All @@ -95,7 +95,7 @@ Array [
},
],
Array [
"/usr/local/bin/node",
"{NODE}",
Array [
"{CWD}/node_modules/typescript/bin/tsc",
"-p",
Expand All @@ -106,7 +106,7 @@ Array [
},
],
Array [
"/usr/local/bin/node",
"{NODE}",
Array [
"{CWD}/node_modules/typescript/bin/tsc",
"-p",
Expand Down
2 changes: 2 additions & 0 deletions test/build-esm.ts
Expand Up @@ -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<Buffer> = {
status: 0,
signal: null,
Expand Down

0 comments on commit 7844507

Please sign in to comment.