summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-watchfile.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-fs-watchfile.js')
-rw-r--r--test/parallel/test-fs-watchfile.js22
1 files changed, 16 insertions, 6 deletions
diff --git a/test/parallel/test-fs-watchfile.js b/test/parallel/test-fs-watchfile.js
index 43e2594463..f980d8f3fc 100644
--- a/test/parallel/test-fs-watchfile.js
+++ b/test/parallel/test-fs-watchfile.js
@@ -6,13 +6,23 @@ const fs = require('fs');
const path = require('path');
// Basic usage tests.
-assert.throws(function() {
- fs.watchFile('./some-file');
-}, /^Error: "watchFile\(\)" requires a listener function$/);
+common.expectsError(
+ () => {
+ fs.watchFile('./some-file');
+ },
+ {
+ code: 'ERR_INVALID_ARG_TYPE',
+ type: TypeError
+ });
-assert.throws(function() {
- fs.watchFile('./another-file', {}, 'bad listener');
-}, /^Error: "watchFile\(\)" requires a listener function$/);
+common.expectsError(
+ () => {
+ fs.watchFile('./another-file', {}, 'bad listener');
+ },
+ {
+ code: 'ERR_INVALID_ARG_TYPE',
+ type: TypeError
+ });
assert.throws(function() {
fs.watchFile(new Object(), common.mustNotCall());