Skip to content

Commit 5a9d7b3

Browse files
vsemozhetbytMylesBorins
authored andcommitted
test: use string instead of RegExp in split()
PR-URL: #13710 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 6731d1b commit 5a9d7b3

3 files changed

+3
-3
lines changed

test/parallel/test-http-outgoing-first-chunk-singlebyte-encoding.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ for (const enc of ['utf8', 'utf16le', 'latin1', 'UTF-8']) {
2424
const headerEnd = received.indexOf('\r\n\r\n', 'utf8');
2525
assert.notStrictEqual(headerEnd, -1);
2626

27-
const header = received.toString('utf8', 0, headerEnd).split(/\r\n/);
27+
const header = received.toString('utf8', 0, headerEnd).split('\r\n');
2828
const body = received.toString(enc, headerEnd + 4);
2929

3030
assert.strictEqual(header[0], 'HTTP/1.1 200 OK');

test/parallel/test-repl-setprompt.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ child.stdin.end(`e.setPrompt("${p}");${os.EOL}`);
2323
child.on('close', function(code, signal) {
2424
assert.strictEqual(code, 0);
2525
assert.ok(!signal);
26-
const lines = data.split(/\n/);
26+
const lines = data.split('\n');
2727
assert.strictEqual(lines.pop(), p);
2828
});

test/parallel/test-stdin-script-child.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ child.stdout.on('data', function(c) {
1818

1919
child.stderr.setEncoding('utf8');
2020
child.stderr.on('data', function(c) {
21-
console.error(`> ${c.trim().split(/\n/).join('\n> ')}`);
21+
console.error(`> ${c.trim().split('\n').join('\n> ')}`);
2222
});
2323

2424
child.on('close', common.mustCall(function(c) {

0 commit comments

Comments
 (0)