Skip to content

Commit

Permalink
fix flaky test in remove.test.js (#736)
Browse files Browse the repository at this point in the history
  • Loading branch information
nacd authored and RyanZim committed Dec 13, 2019
1 parent 2b97fe3 commit d6478d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/remove/__tests__/remove.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ describe('remove', () => {
fs.writeFileSync(file, 'hello')

assert(fs.existsSync(file))
const existsChecker = setInterval(() => {
let existsChecker = setInterval(() => {
fse.pathExists(file, (err, itDoes) => {
assert.ifError(err)
if (!itDoes) {
if (!itDoes && existsChecker) {
clearInterval(existsChecker)
existsChecker = null
done()
}
})
Expand Down

0 comments on commit d6478d2

Please sign in to comment.