Skip to content

Commit 2a8d293

Browse files
Intregrisistaddaleax
authored andcommitted
test: Update to const and use regex for assertions
Use const over var. Assert error message with regex. PR-URL: #9891 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 295eb5a commit 2a8d293

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/parallel/test-net-localerror.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
4-
var net = require('net');
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const net = require('net');
55

66
connect({
77
host: 'localhost',
88
port: common.PORT,
99
localPort: 'foobar',
10-
}, 'localPort should be a number: foobar');
10+
}, /^TypeError: "localPort" option should be a number: foobar$/);
1111

1212
connect({
1313
host: 'localhost',
1414
port: common.PORT,
1515
localAddress: 'foobar',
16-
}, 'localAddress should be a valid IP: foobar');
16+
}, /^TypeError: "localAddress" option must be a valid IP: foobar$/);
1717

1818
function connect(opts, msg) {
1919
assert.throws(function() {

0 commit comments

Comments
 (0)