Skip to content

Commit e7ff4e0

Browse files
woolterchristian-bromann
authored andcommitted
Fix: webdriverio#4856 condition never reached (webdriverio#4875)
1 parent b040c9d commit e7ff4e0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/wdio-allure-reporter/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ class AllureReporter extends WDIOReporter {
283283
})
284284
}
285285
}
286-
} else if (!this.options.disableMochaHooks) this.onTestPass()
287-
}
286+
}
287+
} else if (!this.options.disableMochaHooks) this.onTestPass()
288288
}
289289

290290
addLabel({ name, value }) {

packages/wdio-allure-reporter/tests/allureFeatures.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,21 +541,21 @@ describe('hooks handling default', () => {
541541
expect(startCase).toHaveBeenCalledTimes(1)
542542
})
543543

544-
it('should not keep passed hooks if there are no steps (before/after)', () => {
544+
it('should keep passed hooks if there are no steps (before/after)', () => {
545545
const testcases = [1]
546546
reporter.allure = allureInstance({ suite: { testcases }, test: { steps: [] } })
547547
reporter.onHookEnd({ title: '"before all" hook', parent: 'foo' })
548548

549-
expect(endCase).toHaveBeenCalledTimes(0)
549+
expect(endCase).toHaveBeenCalledTimes(1)
550550
expect(testcases).toHaveLength(1)
551551
})
552552

553-
it('should not keep passed hooks if there are some steps', () => {
553+
it('should keep passed hooks if there are some steps', () => {
554554
const testcases = [1]
555555
reporter.allure = allureInstance({ suite: { testcases }, test: { steps: [1] } })
556556
reporter.onHookEnd({ title: 'foo', parent: 'bar' })
557557

558-
expect(endCase).toHaveBeenCalledTimes(0)
558+
expect(endCase).toHaveBeenCalledTimes(1)
559559
expect(testcases).toHaveLength(1)
560560
})
561561
})

0 commit comments

Comments
 (0)