@@ -190,29 +190,29 @@ describe('lib', () => {
190
190
'The contents of this file\nwill be monitored for quality assurance purposes\n'
191
191
)
192
192
} )
193
+ } )
193
194
194
- describe ( 'setFileContents' , async ( ) => {
195
- const fs = new FileSystem ( __dirname )
196
- const filePath = path . resolve ( __dirname , 'text_file_for_test.txt' )
197
- const contents = await realFs . promises . readFile ( filePath )
195
+ describe ( 'setFileContents' , async ( ) => {
196
+ const fs = new FileSystem ( __dirname )
197
+ const filePath = path . resolve ( __dirname , 'text_file_for_test.txt' )
198
+ const contents = await realFs . promises . readFile ( filePath )
198
199
199
- it ( 'should return undefined if the file does not exist' , async ( ) => {
200
- const actual = await fs . getFileContents ( 'notAFile' )
201
- expect ( actual ) . to . equal ( undefined )
202
- } )
200
+ it ( 'should return undefined if the file does not exist' , async ( ) => {
201
+ const actual = await fs . getFileContents ( 'notAFile' )
202
+ expect ( actual ) . to . equal ( undefined )
203
+ } )
203
204
204
- it ( 'should change the contents of a file' , async ( ) => {
205
- const expected = 'somefilecontents\nmorecontents\n'
206
- await fs . setFileContents ( 'text_file_for_test.txt' , expected )
207
- const fileContents = await realFs . promises . readFile ( filePath , 'utf8' )
208
- const realFileContents = fileContents . replace ( / \r / g, '' )
209
- expect ( realFileContents ) . to . equal ( expected )
210
- } )
205
+ it ( 'should change the contents of a file' , async ( ) => {
206
+ const expected = 'somefilecontents\nmorecontents\n'
207
+ await fs . setFileContents ( 'text_file_for_test.txt' , expected )
208
+ const fileContents = await realFs . promises . readFile ( filePath , 'utf8' )
209
+ const realFileContents = fileContents . replace ( / \r / g, '' )
210
+ expect ( realFileContents ) . to . equal ( expected )
211
+ } )
211
212
212
- after ( async ( ) => {
213
- // reset the file contents
214
- await realFs . promises . writeFile ( filePath , contents )
215
- } )
213
+ after ( async ( ) => {
214
+ // reset the file contents
215
+ await realFs . promises . writeFile ( filePath , contents )
216
216
} )
217
217
} )
218
218
0 commit comments