Skip to content

Commit

Permalink
test: replace assert.throws w/ common.expectsError
Browse files Browse the repository at this point in the history
PR-URL: #17091
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
  • Loading branch information
SethGreylyn authored and MylesBorins committed Dec 11, 2017
1 parent e7db034 commit 9914bca
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/parallel/test-next-tick-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand All @@ -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
}
);
}

Expand Down

0 comments on commit 9914bca

Please sign in to comment.