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‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
'use strict';
2-
varcommon=require('../common');
3-
varassert=require('assert');
4-
varnet=require('net');
2+
constcommon=require('../common');
3+
constassert=require('assert');
4+
constnet=require('net');
55

66
connect({
77
host: 'localhost',
88
port: common.PORT,
99
localPort: 'foobar',
10-
},'localPortshould be a number: foobar');
10+
},/^TypeError:"localPort"optionshouldbeanumber: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"optionmustbeavalidIP:foobar$/);
1717

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

0 commit comments

Comments
(0)