Skip to content

Commit

Permalink
test: fix done() called multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
exuanbo committed Nov 18, 2020
1 parent 5655469 commit 8ba80f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion __tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ const getFile = file => {
const compare = (stream, fixtureName, expectedName, done, expectedErr) => {
stream.on('error', err => {
if (expectedErr) {
expect(err.message).to.equal(expectedErr)
try {
expect(err.message).to.equal(expectedErr)
} catch (assertionError) {
done(assertionError)
return
}
done()
return
}
Expand Down

0 comments on commit 8ba80f0

Please sign in to comment.