@@ -36,10 +36,10 @@ assert.doesNotThrow(
36
36
function ( ) {
37
37
const watcher = fs . watch ( filepathOne ) ;
38
38
watcher . on ( 'change' , function ( event , filename ) {
39
- assert . strictEqual ( 'change' , event ) ;
39
+ assert . strictEqual ( event , 'change' ) ;
40
40
41
41
if ( expectFilePath ) {
42
- assert . strictEqual ( 'watch.txt' , filename ) ;
42
+ assert . strictEqual ( filename , 'watch.txt' ) ;
43
43
}
44
44
watcher . close ( ) ;
45
45
++ watchSeenOne ;
@@ -59,10 +59,10 @@ fs.writeFileSync(filepathTwoAbs, 'howdy');
59
59
assert . doesNotThrow (
60
60
function ( ) {
61
61
const watcher = fs . watch ( filepathTwo , function ( event , filename ) {
62
- assert . strictEqual ( 'change' , event ) ;
62
+ assert . strictEqual ( event , 'change' ) ;
63
63
64
64
if ( expectFilePath ) {
65
- assert . strictEqual ( 'hasOwnProperty' , filename ) ;
65
+ assert . strictEqual ( filename , 'hasOwnProperty' ) ;
66
66
}
67
67
watcher . close ( ) ;
68
68
++ watchSeenTwo ;
@@ -82,11 +82,11 @@ assert.doesNotThrow(
82
82
function ( ) {
83
83
const watcher = fs . watch ( testsubdir , function ( event , filename ) {
84
84
const renameEv = common . isSunOS || common . isAix ? 'change' : 'rename' ;
85
- assert . strictEqual ( renameEv , event ) ;
85
+ assert . strictEqual ( event , renameEv ) ;
86
86
if ( expectFilePath ) {
87
- assert . strictEqual ( 'newfile.txt' , filename ) ;
87
+ assert . strictEqual ( filename , 'newfile.txt' ) ;
88
88
} else {
89
- assert . strictEqual ( null , filename ) ;
89
+ assert . strictEqual ( filename , null ) ;
90
90
}
91
91
watcher . close ( ) ;
92
92
++ watchSeenThree ;
@@ -113,13 +113,13 @@ assert.throws(function() {
113
113
oldhandle = w . _handle ;
114
114
w . _handle = { close : w . _handle . close } ;
115
115
w . close ( ) ;
116
- } , TypeError ) ;
116
+ } , / ^ T y p e E r r o r : I l l e g a l i n v o c a t i o n $ / ) ;
117
117
oldhandle . close ( ) ; // clean up
118
118
119
119
assert . throws ( function ( ) {
120
120
const w = fs . watchFile ( __filename , { persistent : false } , function ( ) { } ) ;
121
121
oldhandle = w . _handle ;
122
122
w . _handle = { stop : w . _handle . stop } ;
123
123
w . stop ( ) ;
124
- } , TypeError ) ;
124
+ } , / ^ T y p e E r r o r : I l l e g a l i n v o c a t i o n $ / ) ;
125
125
oldhandle . stop ( ) ; // clean up
0 commit comments