GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: fix test/pummel/test-fs-watch-file.js · nodejs/node@bdcf8f4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/pummel
    • test-fs-watch-file.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/pummel/test-fs-watch-file.js‎

Copy file name to clipboardExpand all lines: test/pummel/test-fs-watch-file.js
+7-14Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,8 @@ process.on('exit', function() {
6060
fs.writeFileSync(filepathOne, 'hello');
6161

6262
assert.throws(
63-
function() {
64-
fs.watchFile(filepathOne);
65-
},
66-
function(e) {
67-
return e.message === '"watchFile()" requires a listener function';
68-
}
63+
() => { fs.watchFile(filepathOne); },
64+
{ code: 'ERR_INVALID_ARG_TYPE' }
6965
);
7066

7167
// Does not throw.
@@ -84,12 +80,8 @@ process.chdir(testDir);
8480
fs.writeFileSync(filepathTwoAbs, 'howdy');
8581

8682
assert.throws(
87-
function() {
88-
fs.watchFile(filepathTwo);
89-
},
90-
function(e) {
91-
return e.message === '"watchFile()" requires a listener function';
92-
}
83+
() => { fs.watchFile(filepathTwo); },
84+
{ code: 'ERR_INVALID_ARG_TYPE' }
9385
);
9486

9587
{ // Does not throw.
@@ -114,9 +106,10 @@ setTimeout(function() {
114106
fs.unwatchFile(filenameThree, b);
115107
++watchSeenThree;
116108
}
117-
fs.watchFile(filenameThree, common.mustNotCall());
109+
const uncalledListener = common.mustNotCall();
110+
fs.watchFile(filenameThree, uncalledListener);
118111
fs.watchFile(filenameThree, b);
119-
fs.unwatchFile(filenameThree, common.mustNotCall());
112+
fs.unwatchFile(filenameThree, uncalledListener);
120113
}
121114

122115
setTimeout(function() {

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.