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:
sgreylyn 2017-11-16 22:46:14 -08:00 committed by Anatoli Papirovski
parent e51216d722
commit 52010553d3
No known key found for this signature in database
GPG Key ID: 614E2E1ABEB4B2C0

View File

@ -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
}
);
}