mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 07:27:22 +01:00
test: Update to const and use regex for assertions
Use const over var. Assert error message with regex. PR-URL: https://github.com/nodejs/node/pull/9891 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
f9274f072c
commit
4a204ee24c
@ -1,19 +1,19 @@
|
||||
'use strict';
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
var net = require('net');
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const net = require('net');
|
||||
|
||||
connect({
|
||||
host: 'localhost',
|
||||
port: common.PORT,
|
||||
localPort: 'foobar',
|
||||
}, 'localPort should be a number: foobar');
|
||||
}, /^TypeError: "localPort" option should be a number: foobar$/);
|
||||
|
||||
connect({
|
||||
host: 'localhost',
|
||||
port: common.PORT,
|
||||
localAddress: 'foobar',
|
||||
}, 'localAddress should be a valid IP: foobar');
|
||||
}, /^TypeError: "localAddress" option must be a valid IP: foobar$/);
|
||||
|
||||
function connect(opts, msg) {
|
||||
assert.throws(function() {
|
||||
|
Loading…
Reference in New Issue
Block a user