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: cleanup test-fs-watch.js · nodejs/node@a714449

File tree

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

‎test/sequential/test-fs-watch.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-fs-watch.js
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ assert.doesNotThrow(
3535
function() {
3636
const watcher = fs.watch(filepathOne);
3737
watcher.on('change', function(event, filename) {
38-
assert.strictEqual('change', event);
38+
assert.strictEqual(event, 'change');
3939

4040
if (expectFilePath) {
41-
assert.strictEqual('watch.txt', filename);
41+
assert.strictEqual(filename, 'watch.txt');
4242
}
4343
watcher.close();
4444
++watchSeenOne;
@@ -58,10 +58,10 @@ fs.writeFileSync(filepathTwoAbs, 'howdy');
5858
assert.doesNotThrow(
5959
function() {
6060
const watcher = fs.watch(filepathTwo, function(event, filename) {
61-
assert.strictEqual('change', event);
61+
assert.strictEqual(event, 'change');
6262

6363
if (expectFilePath) {
64-
assert.strictEqual('hasOwnProperty', filename);
64+
assert.strictEqual(filename, 'hasOwnProperty');
6565
}
6666
watcher.close();
6767
++watchSeenTwo;
@@ -83,9 +83,9 @@ assert.doesNotThrow(
8383
const renameEv = common.isSunOS ? 'change' : 'rename';
8484
assert.strictEqual(renameEv, event);
8585
if (expectFilePath) {
86-
assert.strictEqual('newfile.txt', filename);
86+
assert.strictEqual(filename, 'newfile.txt');
8787
} else {
88-
assert.strictEqual(null, filename);
88+
assert.strictEqual(filename, null);
8989
}
9090
watcher.close();
9191
++watchSeenThree;
@@ -112,13 +112,13 @@ assert.throws(function() {
112112
oldhandle = w._handle;
113113
w._handle = { close: w._handle.close };
114114
w.close();
115-
}, TypeError);
115+
}, /^TypeError: Illegal invocation$/);
116116
oldhandle.close(); // clean up
117117

118118
assert.throws(function() {
119119
const w = fs.watchFile(__filename, {persistent: false}, function() {});
120120
oldhandle = w._handle;
121121
w._handle = { stop: w._handle.stop };
122122
w.stop();
123-
}, TypeError);
123+
}, /^TypeError: Illegal invocation$/);
124124
oldhandle.stop(); // clean up

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.