@@ -36,10 +36,10 @@ assert.doesNotThrow(
3636 function ( ) {
3737 const watcher = fs . watch ( filepathOne ) ;
3838 watcher . on ( 'change' , function ( event , filename ) {
39- assert . strictEqual ( 'change' , event ) ;
39+ assert . strictEqual ( event , 'change' ) ;
4040
4141 if ( expectFilePath ) {
42- assert . strictEqual ( 'watch.txt' , filename ) ;
42+ assert . strictEqual ( filename , 'watch.txt' ) ;
4343 }
4444 watcher . close ( ) ;
4545 ++ watchSeenOne ;
@@ -59,10 +59,10 @@ fs.writeFileSync(filepathTwoAbs, 'howdy');
5959assert . doesNotThrow (
6060 function ( ) {
6161 const watcher = fs . watch ( filepathTwo , function ( event , filename ) {
62- assert . strictEqual ( 'change' , event ) ;
62+ assert . strictEqual ( event , 'change' ) ;
6363
6464 if ( expectFilePath ) {
65- assert . strictEqual ( 'hasOwnProperty' , filename ) ;
65+ assert . strictEqual ( filename , 'hasOwnProperty' ) ;
6666 }
6767 watcher . close ( ) ;
6868 ++ watchSeenTwo ;
@@ -82,11 +82,11 @@ assert.doesNotThrow(
8282 function ( ) {
8383 const watcher = fs . watch ( testsubdir , function ( event , filename ) {
8484 const renameEv = common . isSunOS || common . isAix ? 'change' : 'rename' ;
85- assert . strictEqual ( renameEv , event ) ;
85+ assert . strictEqual ( event , renameEv ) ;
8686 if ( expectFilePath ) {
87- assert . strictEqual ( 'newfile.txt' , filename ) ;
87+ assert . strictEqual ( filename , 'newfile.txt' ) ;
8888 } else {
89- assert . strictEqual ( null , filename ) ;
89+ assert . strictEqual ( filename , null ) ;
9090 }
9191 watcher . close ( ) ;
9292 ++ watchSeenThree ;
@@ -113,13 +113,13 @@ assert.throws(function() {
113113 oldhandle = w . _handle ;
114114 w . _handle = { close : w . _handle . close } ;
115115 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 $ / ) ;
117117oldhandle . close ( ) ; // clean up
118118
119119assert . throws ( function ( ) {
120120 const w = fs . watchFile ( __filename , { persistent : false } , function ( ) { } ) ;
121121 oldhandle = w . _handle ;
122122 w . _handle = { stop : w . _handle . stop } ;
123123 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 $ / ) ;
125125oldhandle . stop ( ) ; // clean up
0 commit comments