test: remove undefined function

`common.fail()` no longer exists as its functionality is now in
`assert.fail()`. Replace only two instances in the code base with
`assert.fail()`.

PR-URL: https://github.com/nodejs/node/pull/17845
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
This commit is contained in:
Rich Trott 2017-12-23 14:40:49 -08:00 committed by Weijia Wang
parent 094d92bb57
commit 8331f571ed
2 changed files with 4 additions and 2 deletions

View File

@ -7,7 +7,7 @@ const timers = require('timers');
const OVERFLOW = Math.pow(2, 31); // TIMEOUT_MAX is 2^31-1
function timerNotCanceled() {
common.fail('Timer should be canceled');
assert.fail('Timer should be canceled');
}
process.on('warning', common.mustCall((warning) => {

View File

@ -1,6 +1,8 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');
let time = Date.now();
@ -16,7 +18,7 @@ const server = http.createServer((req, res) => {
req.setTimeout(TIMEOUT, () => {
if (!intervalWasInvoked)
return common.skip('interval was not invoked quickly enough for test');
common.fail('Request timeout should not fire');
assert.fail('Request timeout should not fire');
});
req.resume();