mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 22:31:35 +00:00

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>
16 lines
329 B
JavaScript
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();
|