Skip to content

Commit

Permalink
guard against hook.errors being undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
fijijavis committed Jul 23, 2019
1 parent 4a97e1f commit e8f360f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mapHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function (suiteHooks) {
hookResult.title = hook.title
hookResult.associatedSuite = hook.parent
hookResult.associatedTest = hook.currentTest
hookResult.state = hook.errors.length ? hook.state : 'passed'
hookResult.state = hook.errors && hook.errors.length ? hook.state : 'passed'

if (hook.error) {
if (hook.error.type) {
Expand Down

0 comments on commit e8f360f

Please sign in to comment.