@@ -57,10 +57,10 @@ assert.doesNotThrow(
5757 function ( ) {
5858 const watcher = fs . watch ( filepathOne ) ;
5959 watcher . on ( 'change' , function ( event , filename ) {
60- assert . strictEqual ( 'change' , event ) ;
60+ assert . strictEqual ( event , 'change' ) ;
6161
6262 if ( expectFilePath ) {
63- assert . strictEqual ( 'watch.txt' , filename ) ;
63+ assert . strictEqual ( filename , 'watch.txt' ) ;
6464 }
6565 watcher . close ( ) ;
6666 ++ watchSeenOne ;
@@ -80,10 +80,10 @@ fs.writeFileSync(filepathTwoAbs, 'howdy');
8080assert . doesNotThrow (
8181 function ( ) {
8282 const watcher = fs . watch ( filepathTwo , function ( event , filename ) {
83- assert . strictEqual ( 'change' , event ) ;
83+ assert . strictEqual ( event , 'change' ) ;
8484
8585 if ( expectFilePath ) {
86- assert . strictEqual ( 'hasOwnProperty' , filename ) ;
86+ assert . strictEqual ( filename , 'hasOwnProperty' ) ;
8787 }
8888 watcher . close ( ) ;
8989 ++ watchSeenTwo ;
@@ -103,11 +103,11 @@ assert.doesNotThrow(
103103 function ( ) {
104104 const watcher = fs . watch ( testsubdir , function ( event , filename ) {
105105 const renameEv = common . isSunOS || common . isAix ? 'change' : 'rename' ;
106- assert . strictEqual ( renameEv , event ) ;
106+ assert . strictEqual ( event , renameEv ) ;
107107 if ( expectFilePath ) {
108- assert . strictEqual ( 'newfile.txt' , filename ) ;
108+ assert . strictEqual ( filename , 'newfile.txt' ) ;
109109 } else {
110- assert . strictEqual ( null , filename ) ;
110+ assert . strictEqual ( filename , null ) ;
111111 }
112112 watcher . close ( ) ;
113113 ++ watchSeenThree ;
@@ -134,13 +134,13 @@ assert.throws(function() {
134134 oldhandle = w . _handle ;
135135 w . _handle = { close : w . _handle . close } ;
136136 w . close ( ) ;
137- } , TypeError ) ;
137+ } , / ^ 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 $ / ) ;
138138oldhandle . close ( ) ; // clean up
139139
140140assert . throws ( function ( ) {
141141 const w = fs . watchFile ( __filename , { persistent : false } , common . noop ) ;
142142 oldhandle = w . _handle ;
143143 w . _handle = { stop : w . _handle . stop } ;
144144 w . stop ( ) ;
145- } , TypeError ) ;
145+ } , / ^ 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 $ / ) ;
146146oldhandle . stop ( ) ; // clean up
0 commit comments