test: replace assert.throws w/ common.expectsError
PR-URL: https://github.com/nodejs/node/pull/17091 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
parent
e51216d722
commit
52010553d3
@ -20,7 +20,7 @@
|
||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
'use strict';
|
||||
require('../common');
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
|
||||
const order = [];
|
||||
@ -42,11 +42,15 @@ process.nextTick(function() {
|
||||
});
|
||||
|
||||
function testNextTickWith(val) {
|
||||
assert.throws(
|
||||
common.expectsError(
|
||||
function() {
|
||||
process.nextTick(val);
|
||||
},
|
||||
TypeError
|
||||
{
|
||||
code: 'ERR_INVALID_CALLBACK',
|
||||
name: 'TypeError [ERR_INVALID_CALLBACK]',
|
||||
type: TypeError
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user