Skip to content

Commit 900ee37

Browse files
fix: add await
Signed-off-by: Scott Schreckengaust <[email protected]>
1 parent a217600 commit 900ee37

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tests/lib/file_system_tests.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,10 @@ describe('lib', () => {
204204

205205
it('should change the contents of a file', async () => {
206206
const expected = 'somefilecontents\nmorecontents\n'
207-
fs.setFileContents('text_file_for_test.txt', expected).then(() => {
208-
const fileContents = await realFs.promises.readFile(filePath, 'utf8')
209-
const realFileContents = fileContents.replace(/\r/g, '')
210-
expect(realFileContents).to.equal(expected)
211-
}).catch(
212-
//TODO: raise exception....
213-
);
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)
214211
})
215212

216213
after(async () => {

0 commit comments

Comments
 (0)