diff --git a/test/sequential/test-fs-watch.js b/test/sequential/test-fs-watch.js index 34e53f59aa09..3d8fa3ab2908 100644 --- a/test/sequential/test-fs-watch.js +++ b/test/sequential/test-fs-watch.js @@ -35,10 +35,10 @@ assert.doesNotThrow( function() { const watcher = fs.watch(filepathOne); watcher.on('change', function(event, filename) { - assert.strictEqual('change', event); + assert.strictEqual(event, 'change'); if (expectFilePath) { - assert.strictEqual('watch.txt', filename); + assert.strictEqual(filename, 'watch.txt'); } watcher.close(); ++watchSeenOne; @@ -58,10 +58,10 @@ fs.writeFileSync(filepathTwoAbs, 'howdy'); assert.doesNotThrow( function() { const watcher = fs.watch(filepathTwo, function(event, filename) { - assert.strictEqual('change', event); + assert.strictEqual(event, 'change'); if (expectFilePath) { - assert.strictEqual('hasOwnProperty', filename); + assert.strictEqual(filename, 'hasOwnProperty'); } watcher.close(); ++watchSeenTwo; @@ -83,9 +83,9 @@ assert.doesNotThrow( const renameEv = common.isSunOS ? 'change' : 'rename'; assert.strictEqual(renameEv, event); if (expectFilePath) { - assert.strictEqual('newfile.txt', filename); + assert.strictEqual(filename, 'newfile.txt'); } else { - assert.strictEqual(null, filename); + assert.strictEqual(filename, null); } watcher.close(); ++watchSeenThree; @@ -112,7 +112,7 @@ assert.throws(function() { oldhandle = w._handle; w._handle = { close: w._handle.close }; w.close(); -}, TypeError); +}, /^TypeError: Illegal invocation$/); oldhandle.close(); // clean up assert.throws(function() { @@ -120,5 +120,5 @@ assert.throws(function() { oldhandle = w._handle; w._handle = { stop: w._handle.stop }; w.stop(); -}, TypeError); +}, /^TypeError: Illegal invocation$/); oldhandle.stop(); // clean up