The Wayback Machine - https://web.archive.org/web/20250407172928/https://github.com/nodejs/node/commit/8097b3b1ec
Skip to content

Navigation Menu

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

Commit 8097b3b

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 6d5b215 commit 8097b3b
Copy full SHA for 8097b3b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Copy file name to clipboardexpand all lines: 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.