Skip to content

Commit 1fc39d5

Browse files
committed
test: fix invalid output TAP if there newline in test name
1 parent 1287530 commit 1fc39d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/test_runner/tap_stream.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ class TapStream extends Readable {
131131

132132
// In certain places, # and \ need to be escaped as \# and \\.
133133
function tapEscape(input) {
134-
return StringPrototypeReplaceAll(
134+
return StringPrototypeReplaceAll(StringPrototypeReplaceAll(
135135
StringPrototypeReplaceAll(input, '\\', '\\\\'), '#', '\\#'
136-
);
136+
), '\n', '\\n');
137137
}
138138

139139
function jsToYaml(indent, name, value) {

0 commit comments

Comments
 (0)