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 authored and Anatoli Papirovski committed 2017-11-20 09:56:08 -05:00
1 parent e51216d722
commit 52010553d3
1 file changed
+7 -3
+7 -3
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
}
);
}