@@ -35,10 +35,10 @@ assert.doesNotThrow( |
35 | 35 | function() { |
36 | 36 | const watcher = fs.watch(filepathOne); |
37 | 37 | watcher.on('change', function(event, filename) { |
38 | | - assert.strictEqual('change', event); |
| 38 | + assert.strictEqual(event, 'change'); |
39 | 39 |
|
40 | 40 | if (expectFilePath) { |
41 | | - assert.strictEqual('watch.txt', filename); |
| 41 | + assert.strictEqual(filename, 'watch.txt'); |
42 | 42 | } |
43 | 43 | watcher.close(); |
44 | 44 | ++watchSeenOne; |
@@ -58,10 +58,10 @@ fs.writeFileSync(filepathTwoAbs, 'howdy'); |
58 | 58 | assert.doesNotThrow( |
59 | 59 | function() { |
60 | 60 | const watcher = fs.watch(filepathTwo, function(event, filename) { |
61 | | - assert.strictEqual('change', event); |
| 61 | + assert.strictEqual(event, 'change'); |
62 | 62 |
|
63 | 63 | if (expectFilePath) { |
64 | | - assert.strictEqual('hasOwnProperty', filename); |
| 64 | + assert.strictEqual(filename, 'hasOwnProperty'); |
65 | 65 | } |
66 | 66 | watcher.close(); |
67 | 67 | ++watchSeenTwo; |
@@ -83,9 +83,9 @@ assert.doesNotThrow( |
83 | 83 | const renameEv = common.isSunOS ? 'change' : 'rename'; |
84 | 84 | assert.strictEqual(renameEv, event); |
85 | 85 | if (expectFilePath) { |
86 | | - assert.strictEqual('newfile.txt', filename); |
| 86 | + assert.strictEqual(filename, 'newfile.txt'); |
87 | 87 | } else { |
88 | | - assert.strictEqual(null, filename); |
| 88 | + assert.strictEqual(filename, null); |
89 | 89 | } |
90 | 90 | watcher.close(); |
91 | 91 | ++watchSeenThree; |
@@ -112,13 +112,13 @@ assert.throws(function() { |
112 | 112 | oldhandle = w._handle; |
113 | 113 | w._handle = { close: w._handle.close }; |
114 | 114 | w.close(); |
115 | | -}, TypeError); |
| 115 | +}, /^TypeError: Illegal invocation$/); |
116 | 116 | oldhandle.close(); // clean up |
117 | 117 |
|
118 | 118 | assert.throws(function() { |
119 | 119 | const w = fs.watchFile(__filename, {persistent: false}, function() {}); |
120 | 120 | oldhandle = w._handle; |
121 | 121 | w._handle = { stop: w._handle.stop }; |
122 | 122 | w.stop(); |
123 | | -}, TypeError); |
| 123 | +}, /^TypeError: Illegal invocation$/); |
124 | 124 | oldhandle.stop(); // clean up |