We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fc39d5 commit bbba3c7Copy full SHA for bbba3c7
lib/internal/test_runner/tap_stream.js
@@ -131,9 +131,18 @@ class TapStream extends Readable {
131
132
// In certain places, # and \ need to be escaped as \# and \\.
133
function tapEscape(input) {
134
- return StringPrototypeReplaceAll(StringPrototypeReplaceAll(
135
- StringPrototypeReplaceAll(input, '\\', '\\\\'), '#', '\\#'
136
- ), '\n', '\\n');
+ [{ escapeChar: '\\', tappedEscape: '\\\\' },
+ { escapeChar: '#', tappedEscape: '\\#' },
+ { escapeChar: '\n', tappedEscape: '\\n' },
137
+ { escapeChar: '\t', tappedEscape: '\\t' },
138
+ { escapeChar: '\r', tappedEscape: '\\r' },
139
+ { escapeChar: '\f', tappedEscape: '\\f' },
140
+ { escapeChar: '\b', tappedEscape: '\\b' },
141
+ { escapeChar: '\v', tappedEscape: '\\v' },
142
+ ].forEach(({ escapeChar, tappedEscape }) => {
143
+ input = StringPrototypeReplaceAll(input, escapeChar, tappedEscape);
144
+ });
145
+ return input;
146
}
147
148
function jsToYaml(indent, name, value) {
0 commit comments