File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,19 +107,20 @@ Child ${config2Name}:
107107describe ( "appendFile functionality" , ( ) => {
108108 describe ( "positive test-cases" , ( ) => {
109109 const junkFile = resolve ( __dirname , "junkFile.js" ) ;
110+ const initialJunkData = "initial junk data" ;
111+ const junkComment = "//junk comment" ;
110112
111113 beforeEach ( ( ) => {
112- writeFileSync ( junkFile , "" ) ;
114+ writeFileSync ( junkFile , initialJunkData ) ;
113115 } ) ;
114116 afterEach ( ( ) => {
115117 unlinkSync ( junkFile ) ;
116118 } ) ;
117119 it ( "should append data to file if file exists" , ( ) => {
118- const expectedData = "//junk comment" ;
119- appendDataIfFileExists ( __dirname , junkFile , expectedData ) ;
120+ appendDataIfFileExists ( __dirname , junkFile , junkComment ) ;
120121 const actualData = readFileSync ( junkFile ) . toString ( ) ;
121122
122- expect ( actualData ) . toBe ( expectedData ) ;
123+ expect ( actualData ) . toBe ( initialJunkData + junkComment ) ;
123124 } ) ;
124125 } ) ;
125126
You can’t perform that action at this time.
0 commit comments