Skip to content

Commit 1cc266f

Browse files
committed
test: handle windows paths in sourcemap paths
1 parent df78c1b commit 1cc266f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/service/compile.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,13 @@ for (const tsconfigModule of ['commonjs', 'esnext', 'nodenext']) {
107107
`${process.argv[0]} --enable-source-maps ${outputPath}`
108108
).toString()
109109
const stackTracePath =
110-
stdout.match(/^\s+at [^\(]+\(([^:]+)/m)?.[1] ?? ''
111-
t.equal(resolve(stackTracePath), resolve(sourcePath))
110+
stdout.match(
111+
/^\s+at [^\(]+\((([a-zA-Z]:)?[^:]+)/im
112+
)?.[1] ?? ''
113+
t.equal(
114+
resolve(stackTracePath).toLowerCase(),
115+
resolve(sourcePath).toLowerCase()
116+
)
112117
})
113118
t.test('chdir', async () => process.chdir(cwd))
114119
})

0 commit comments

Comments
 (0)