@@ -732,7 +732,7 @@ describe('renameDefault', () => {
732732
733733describe ( 'test behavior for new file' , ( ) => {
734734 before ( ( ) => {
735- fs . writeFileSync ( testFilePath ( './no-unused-modules/file-added-0.js' ) , '' , { encoding : 'utf8' } ) ;
735+ fs . writeFileSync ( testFilePath ( './no-unused-modules/file-added-0.js' ) , '' , { encoding : 'utf8' , flag : 'w' } ) ;
736736 } ) ;
737737
738738 // add import in newly created file
@@ -840,7 +840,7 @@ describe('test behavior for new file', () => {
840840
841841 describe ( 'test behavior for new file' , ( ) => {
842842 before ( ( ) => {
843- fs . writeFileSync ( testFilePath ( './no-unused-modules/file-added-1.js' ) , '' , { encoding : 'utf8' } ) ;
843+ fs . writeFileSync ( testFilePath ( './no-unused-modules/file-added-1.js' ) , '' , { encoding : 'utf8' , flag : 'w' } ) ;
844844 } ) ;
845845 ruleTester . run ( 'no-unused-modules' , rule , {
846846 valid : [
@@ -875,7 +875,7 @@ describe('test behavior for new file', () => {
875875
876876describe ( 'test behavior for new file' , ( ) => {
877877 before ( ( ) => {
878- fs . writeFileSync ( testFilePath ( './no-unused-modules/file-added-2.js' ) , '' , { encoding : 'utf8' } ) ;
878+ fs . writeFileSync ( testFilePath ( './no-unused-modules/file-added-2.js' ) , '' , { encoding : 'utf8' , flag : 'w' } ) ;
879879 } ) ;
880880 ruleTester . run ( 'no-unused-modules' , rule , {
881881 valid : [
@@ -901,7 +901,7 @@ describe('test behavior for new file', () => {
901901
902902describe ( 'test behavior for new file' , ( ) => {
903903 before ( ( ) => {
904- fs . writeFileSync ( testFilePath ( './no-unused-modules/file-added-3.js' ) , '' , { encoding : 'utf8' } ) ;
904+ fs . writeFileSync ( testFilePath ( './no-unused-modules/file-added-3.js' ) , '' , { encoding : 'utf8' , flag : 'w' } ) ;
905905 } ) ;
906906 ruleTester . run ( 'no-unused-modules' , rule , {
907907 valid : [
@@ -952,7 +952,7 @@ describe('test behavior for destructured exports', () => {
952952
953953describe ( 'test behavior for new file' , ( ) => {
954954 before ( ( ) => {
955- fs . writeFileSync ( testFilePath ( './no-unused-modules/file-added-4.js.js' ) , '' , { encoding : 'utf8' } ) ;
955+ fs . writeFileSync ( testFilePath ( './no-unused-modules/file-added-4.js.js' ) , '' , { encoding : 'utf8' , flag : 'w' } ) ;
956956 } ) ;
957957 ruleTester . run ( 'no-unused-modules' , rule , {
958958 valid : [
0 commit comments