node/test/parallel/test-net-connect-paused-connection.js
Rich Trott 676e61872f test: apply correct assert.fail() arguments
The assert.fail function signature has the message as the third argument
but, understandably, it is often assumed that it is the first argument
(or at least the first argument if no other arguments are passed).

This corrects the assert.fail() invocations in the Node.js tests.

Before:
assert.fail('message');
// result: AssertionError: 'message' undefined undefined

After:
assert.fail(null, null, 'message');
// result: AssertionError: message

PR-URL: https://github.com/nodejs/node/pull/3378
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-10-16 00:31:04 -07:00

16 lines
329 B
JavaScript

'use strict';
var assert = require('assert');
var common = require('../common');
var net = require('net');
net.createServer(function(conn) {
conn.unref();
}).listen(common.PORT).unref();
net.connect(common.PORT, 'localhost').pause();
setTimeout(function() {
assert.fail(null, null, 'expected to exit');
}, 1000).unref();