diff --git a/test/parallel/test-fs-make-callback.js b/test/parallel/test-fs-make-callback.js index 6e4572ee35..40c9aa4299 100644 --- a/test/parallel/test-fs-make-callback.js +++ b/test/parallel/test-fs-make-callback.js @@ -2,6 +2,7 @@ const common = require('../common'); const assert = require('assert'); const fs = require('fs'); +const cbTypeError = /^TypeError: "callback" argument must be a function$/; function test(cb) { return function() { @@ -26,13 +27,13 @@ process.once('warning', common.mustCall((warning) => { assert.doesNotThrow(test()); function invalidArgumentsTests() { - assert.throws(test(null)); - assert.throws(test(true)); - assert.throws(test(false)); - assert.throws(test(1)); - assert.throws(test(0)); - assert.throws(test('foo')); - assert.throws(test(/foo/)); - assert.throws(test([])); - assert.throws(test({})); + assert.throws(test(null), cbTypeError); + assert.throws(test(true), cbTypeError); + assert.throws(test(false), cbTypeError); + assert.throws(test(1), cbTypeError); + assert.throws(test(0), cbTypeError); + assert.throws(test('foo'), cbTypeError); + assert.throws(test(/foo/), cbTypeError); + assert.throws(test([]), cbTypeError); + assert.throws(test({}), cbTypeError); }