Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2a8d293

Browse filesBrowse 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 <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 295eb5a commit 2a8d293
Copy full SHA for 2a8d293

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-net-localerror.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-net-localerror.js
+5-5Lines changed: 5 additions & 5 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.