Skip to content

Commit e6a320c

Browse files
committed
Document the normalization of the output
1 parent 594c4c5 commit e6a320c

File tree

1 file changed

+12
-6
lines changed
  • v-next/hardhat-node-test-reporter/integration-tests

1 file changed

+12
-6
lines changed

v-next/hardhat-node-test-reporter/integration-tests/index.ts

+12-6
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,16 @@ for (const entry of readdirSync(import.meta.dirname + "/fixture-tests")) {
6060
}
6161

6262
function normalizeOutputs(output: string): string {
63-
return output
64-
.replace(/\(\d+ms\)/, "(Xms)")
65-
.replaceAll("\r\n", "\n")
66-
.replaceAll(/\(.*?:\d+:\d+\)/g, (match) => {
67-
return match.replaceAll(path.sep, "/");
68-
});
63+
return (
64+
output
65+
// Normalize the time it took to run the test
66+
.replace(/\(\d+ms\)/, "(Xms)")
67+
// Normalize windows new lines
68+
.replaceAll("\r\n", "\n")
69+
// Normalize path separators to `/` within the (file:line:column)
70+
// part of the stack traces
71+
.replaceAll(/\(.*?:\d+:\d+\)/g, (match) => {
72+
return match.replaceAll(path.sep, "/");
73+
})
74+
);
6975
}

0 commit comments

Comments
 (0)