Skip to content

Commit

Permalink
Fix fs calls without callback (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
BridgeAR authored and michaelleeallen committed Apr 27, 2018
1 parent 235ba26 commit 4eb394c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/__tests__/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,19 @@ describe('reporter file name', () => {

beforeEach(() => {
// remove default and possible test report file if they exist.
fs.unlink(`${cwd}/test-report.xml`);
fs.unlink(`${cwd}/${filename}`);
fs.unlinkSync(`${cwd}/test-report.xml`);
try {
fs.unlinkSync(`${cwd}/${filename}`);
} catch (err) {
if (err.code !== 'ENOENT') {
throw err;
}
}
process.env.TEST_REPORT_FILENAME = filename;
});

afterEach(() => {
fs.unlink(`${cwd}/${filename}`);
fs.unlinkSync(`${cwd}/${filename}`);
delete process.env.TEST_REPORT_FILENAME;
});

Expand Down

0 comments on commit 4eb394c

Please sign in to comment.