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