Skip to content

Commit 88d2e69

Browse files
vsemozhetbytaddaleax
authored andcommitted
test: remove unneeded string splitting
PR-URL: #12992 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Luca Maraschi <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent 32f01c8 commit 88d2e69

22 files changed

+57
-63
lines changed

test/parallel/test-cluster-dgram-1.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ const dgram = require('dgram');
3030

3131

3232
if (common.isWindows) {
33-
common.skip('dgram clustering is currently not supported ' +
34-
'on windows.');
33+
common.skip('dgram clustering is currently not supported on Windows.');
3534
return;
3635
}
3736

test/parallel/test-cluster-dgram-2.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ const assert = require('assert');
3030

3131

3232
if (common.isWindows) {
33-
common.skip('dgram clustering is currently not supported ' +
34-
'on windows.');
33+
common.skip('dgram clustering is currently not supported on Windows.');
3534
return;
3635
}
3736

test/parallel/test-cluster-dgram-reuse.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ const cluster = require('cluster');
55
const dgram = require('dgram');
66

77
if (common.isWindows) {
8-
common.skip('dgram clustering is currently not supported ' +
9-
'on windows.');
8+
common.skip('dgram clustering is currently not supported on windows.');
109
return;
1110
}
1211

test/parallel/test-cluster-fork-env.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ if (cluster.isWorker) {
5757

5858
process.once('exit', function() {
5959
assert.ok(checks.using, 'The worker did not receive the correct env.');
60-
assert.ok(checks.overwrite, 'The custom environment did not overwrite ' +
61-
'the existing environment.');
60+
assert.ok(
61+
checks.overwrite,
62+
'The custom environment did not overwrite the existing environment.');
6263
});
6364

6465
}

test/parallel/test-cluster-http-pipe.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ const cluster = require('cluster');
2727
const http = require('http');
2828

2929
if (common.isWindows) {
30-
common.skip('It is not possible to send pipe handles over ' +
31-
'the IPC pipe on Windows');
30+
common.skip(
31+
'It is not possible to send pipe handles over the IPC pipe on Windows');
3232
return;
3333
}
3434

test/parallel/test-cluster-worker-isdead.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ const assert = require('assert');
55

66
if (cluster.isMaster) {
77
const worker = cluster.fork();
8-
assert.ok(!worker.isDead(),
9-
'isDead() should return false right after the worker has been ' +
10-
'created.');
8+
assert.ok(
9+
!worker.isDead(),
10+
'isDead() should return false right after the worker has been created.');
1111

1212
worker.on('exit', function() {
1313
assert.ok(worker.isDead(),
14-
'After an event has been emitted, ' +
15-
'isDead should return true');
14+
'After an event has been emitted, isDead should return true');
1615
});
1716

1817
worker.on('message', function(msg) {

test/parallel/test-crypto-padding-aes256.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ crypto.DEFAULT_ENCODING = 'buffer';
3434
function aes256(decipherFinal) {
3535
const iv = Buffer.from('00000000000000000000000000000000', 'hex');
3636
const key = Buffer.from('0123456789abcdef0123456789abcdef' +
37-
'0123456789abcdef0123456789abcdef', 'hex');
37+
'0123456789abcdef0123456789abcdef', 'hex');
3838

3939
function encrypt(val, pad) {
4040
const c = crypto.createCipheriv('aes256', key, iv);

test/parallel/test-crypto-padding.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ const EVEN_LENGTH_ENCRYPTED =
6666
// openssl enc -aes-128-cbc -e -K 5333632e722e652e742e4b2e652e5921 \
6767
// -iv 626c616846697a7a3230313142757a7a -nopad | xxd -p -c256
6868
const EVEN_LENGTH_ENCRYPTED_NOPAD =
69-
'7f57859550d4d2fdb9806da2a750461ab46e' +
70-
'71b3d78ebe2d9684dfc87f7575b9';
69+
'7f57859550d4d2fdb9806da2a750461ab46e71b3d78ebe2d9684dfc87f7575b9';
7170

7271

7372
/*

test/parallel/test-domain-stack-empty-in-process-uncaughtexception.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ const assert = require('assert');
77
const d = domain.create();
88

99
process.on('uncaughtException', common.mustCall(function onUncaught() {
10-
assert.strictEqual(process.domain, null,
11-
'domains stack should be empty in uncaughtException' +
12-
' handler');
10+
assert.strictEqual(
11+
process.domain, null,
12+
'domains stack should be empty in uncaughtException handler');
1313
}));
1414

1515
process.on('beforeExit', common.mustCall(function onBeforeExit() {

test/parallel/test-http-expect-continue.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ let sent_continue = false;
3131
let got_continue = false;
3232

3333
function handler(req, res) {
34-
assert.strictEqual(sent_continue, true, 'Full response sent before ' +
35-
'100 Continue');
34+
assert.strictEqual(sent_continue, true,
35+
'Full response sent before 100 Continue');
3636
console.error('Server sending full response...');
3737
res.writeHead(200, {
3838
'Content-Type': 'text/plain',

test/parallel/test-http-url.parse-auth-with-header-in-request.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ const server = http.createServer(function(request, response) {
3939
});
4040

4141
server.listen(0, function() {
42-
const testURL = url.parse('http://asdf:qwer@localhost:' +
43-
`${this.address().port}`);
42+
const testURL =
43+
url.parse(`http://asdf:qwer@localhost:${this.address().port}`);
4444
// the test here is if you set a specific authorization header in the
4545
// request we should not override that with basic auth
4646
testURL.headers = {

test/parallel/test-http-url.parse-only-support-http-https-protocol.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ assert.throws(function() {
3030
http.request(url.parse('file:///whatever'));
3131
}, function(err) {
3232
if (err instanceof Error) {
33-
assert.strictEqual(err.message, 'Protocol "file:" not supported.' +
34-
' Expected "http:"');
33+
assert.strictEqual(
34+
err.message, 'Protocol "file:" not supported. Expected "http:"');
3535
return true;
3636
}
3737
});
@@ -40,8 +40,8 @@ assert.throws(function() {
4040
http.request(url.parse('mailto:[email protected]'));
4141
}, function(err) {
4242
if (err instanceof Error) {
43-
assert.strictEqual(err.message, 'Protocol "mailto:" not supported.' +
44-
' Expected "http:"');
43+
assert.strictEqual(
44+
err.message, 'Protocol "mailto:" not supported. Expected "http:"');
4545
return true;
4646
}
4747
});
@@ -50,8 +50,8 @@ assert.throws(function() {
5050
http.request(url.parse('ftp://www.example.com'));
5151
}, function(err) {
5252
if (err instanceof Error) {
53-
assert.strictEqual(err.message, 'Protocol "ftp:" not supported.' +
54-
' Expected "http:"');
53+
assert.strictEqual(
54+
err.message, 'Protocol "ftp:" not supported. Expected "http:"');
5555
return true;
5656
}
5757
});
@@ -60,8 +60,8 @@ assert.throws(function() {
6060
http.request(url.parse('javascript:alert(\'hello\');'));
6161
}, function(err) {
6262
if (err instanceof Error) {
63-
assert.strictEqual(err.message, 'Protocol "javascript:" not supported.' +
64-
' Expected "http:"');
63+
assert.strictEqual(
64+
err.message, 'Protocol "javascript:" not supported. Expected "http:"');
6565
return true;
6666
}
6767
});
@@ -70,8 +70,8 @@ assert.throws(function() {
7070
http.request(url.parse('xmpp:[email protected]'));
7171
}, function(err) {
7272
if (err instanceof Error) {
73-
assert.strictEqual(err.message, 'Protocol "xmpp:" not supported.' +
74-
' Expected "http:"');
73+
assert.strictEqual(
74+
err.message, 'Protocol "xmpp:" not supported. Expected "http:"');
7575
return true;
7676
}
7777
});
@@ -80,8 +80,8 @@ assert.throws(function() {
8080
http.request(url.parse('f://some.host/path'));
8181
}, function(err) {
8282
if (err instanceof Error) {
83-
assert.strictEqual(err.message, 'Protocol "f:" not supported.' +
84-
' Expected "http:"');
83+
assert.strictEqual(
84+
err.message, 'Protocol "f:" not supported. Expected "http:"');
8585
return true;
8686
}
8787
});

test/parallel/test-intl.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ if (!common.hasIntl) {
7272

7373
// If list is specified and doesn't contain 'en' then return.
7474
if (process.config.variables.icu_locales && !haveLocale('en')) {
75-
common.skip('detailed Intl tests because English is not ' +
76-
'listed as supported.');
75+
common.skip(
76+
'detailed Intl tests because English is not listed as supported.');
7777
// Smoke test. Does it format anything, or fail?
7878
console.log(`Date(0) formatted to: ${dtf.format(date0)}`);
7979
return;

test/parallel/test-tls-alpn-server-client.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ if (!common.hasCrypto) {
77
}
88

99
if (!process.features.tls_alpn || !process.features.tls_npn) {
10-
common.skip('Skipping because node compiled without NPN or ALPN' +
11-
' feature of OpenSSL.');
10+
common.skip(
11+
'Skipping because node compiled without NPN or ALPN feature of OpenSSL.');
1212
return;
1313
}
1414

test/parallel/test-tls-client-mindhsize.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ function test(size, err, next) {
5353
if (err) {
5454
client.on('error', function(e) {
5555
nerror++;
56-
assert.strictEqual(e.message, 'DH parameter size 1024 is less' +
57-
' than 2048');
56+
assert.strictEqual(e.message,
57+
'DH parameter size 1024 is less than 2048');
5858
server.close();
5959
});
6060
}

test/parallel/test-tls-npn-server-client.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
'use strict';
2323
const common = require('../common');
2424
if (!process.features.tls_npn) {
25-
common.skip('Skipping because node compiled without NPN feature of' +
26-
' OpenSSL.');
25+
common.skip('Skipping because node compiled without NPN feature of OpenSSL.');
2726
return;
2827
}
2928

test/parallel/test-tls-ocsp-callback.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
const common = require('../common');
2424

2525
if (!process.features.tls_ocsp) {
26-
common.skip('node compiled without OpenSSL or ' +
27-
'with old OpenSSL version.');
26+
common.skip('node compiled without OpenSSL or with old OpenSSL version.');
2827
return;
2928
}
3029
if (!common.opensslCli) {

test/parallel/test-tls-sni-option.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
'use strict';
2323
const common = require('../common');
2424
if (!process.features.tls_sni) {
25-
common.skip('node compiled without OpenSSL or ' +
26-
'with old OpenSSL version.');
25+
common.skip('node compiled without OpenSSL or with old OpenSSL version.');
2726
return;
2827
}
2928

test/parallel/test-tls-sni-server-client.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
'use strict';
2323
const common = require('../common');
2424
if (!process.features.tls_sni) {
25-
common.skip('node compiled without OpenSSL or ' +
26-
'with old OpenSSL version.');
25+
common.skip('node compiled without OpenSSL or with old OpenSSL version.');
2726
return;
2827
}
2928

test/parallel/test-url-format-invalid-input.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const throwsObjsAndReportTypes = new Map([
1414
]);
1515

1616
for (const [obj, type] of throwsObjsAndReportTypes) {
17-
const error = new RegExp('^TypeError: Parameter "urlObj" must be an object' +
18-
`, not ${type}$`);
17+
const error = new RegExp(
18+
`^TypeError: Parameter "urlObj" must be an object, not ${type}$`);
1919
assert.throws(function() { url.format(obj); }, error);
2020
}
2121
assert.strictEqual(url.format(''), '');

test/parallel/test-zlib-flush-drain.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@ deflater.on('drain', function() {
3737
});
3838

3939
process.once('exit', function() {
40-
assert.strictEqual(beforeFlush, true, 'before calling flush, writable ' +
41-
'stream should need to drain');
42-
assert.strictEqual(afterFlush, false, 'after calling flush, writable ' +
43-
'stream should not need to drain');
44-
assert.strictEqual(drainCount, 1,
45-
'the deflater should have emitted a single drain event');
46-
assert.strictEqual(flushCount, 2,
47-
'flush should be called twice');
40+
assert.strictEqual(
41+
beforeFlush, true,
42+
'before calling flush, writable stream should need to drain');
43+
assert.strictEqual(
44+
afterFlush, false,
45+
'after calling flush, writable stream should not need to drain');
46+
assert.strictEqual(
47+
drainCount, 1, 'the deflater should have emitted a single drain event');
48+
assert.strictEqual(
49+
flushCount, 2, 'flush should be called twice');
4850
});

test/pummel/test-net-timeout.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ const echo_server = net.createServer(function(socket) {
4040
});
4141

4242
socket.on('error', function(e) {
43-
throw new Error('Server side socket should not get error. ' +
44-
'We disconnect willingly.');
43+
throw new Error(
44+
'Server side socket should not get error. We disconnect willingly.');
4545
});
4646

4747
socket.on('data', function(d) {

0 commit comments

Comments
 (0)