Skip to content

Commit

Permalink
test: handle windows paths in sourcemap paths
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Nov 28, 2023
1 parent df78c1b commit 1cc266f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/service/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,13 @@ for (const tsconfigModule of ['commonjs', 'esnext', 'nodenext']) {
`${process.argv[0]} --enable-source-maps ${outputPath}`
).toString()
const stackTracePath =
stdout.match(/^\s+at [^\(]+\(([^:]+)/m)?.[1] ?? ''
t.equal(resolve(stackTracePath), resolve(sourcePath))
stdout.match(
/^\s+at [^\(]+\((([a-zA-Z]:)?[^:]+)/im
)?.[1] ?? ''
t.equal(
resolve(stackTracePath).toLowerCase(),
resolve(sourcePath).toLowerCase()
)
})
t.test('chdir', async () => process.chdir(cwd))
})
Expand Down

0 comments on commit 1cc266f

Please sign in to comment.