From 8331f571edb27491161589f30e88962dfe436c2c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 23 Dec 2017 14:40:49 -0800 Subject: [PATCH] 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 Reviewed-By: Anatoli Papirovski Reviewed-By: Gireesh Punathil Reviewed-By: Luigi Pinca Reviewed-By: Weijia Wang Reviewed-By: Colin Ihrig Reviewed-By: Yuta Hiroto --- test/parallel/test-timers-max-duration-warning.js | 2 +- test/sequential/test-http-server-consumed-timeout.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-timers-max-duration-warning.js b/test/parallel/test-timers-max-duration-warning.js index b352b745c504de..712b56b8d2e082 100644 --- a/test/parallel/test-timers-max-duration-warning.js +++ b/test/parallel/test-timers-max-duration-warning.js @@ -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) => { diff --git a/test/sequential/test-http-server-consumed-timeout.js b/test/sequential/test-http-server-consumed-timeout.js index abe100c1907e0f..56217226503be1 100644 --- a/test/sequential/test-http-server-consumed-timeout.js +++ b/test/sequential/test-http-server-consumed-timeout.js @@ -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();