Closed delatrie closed 1 week ago
The PR fixes afterEach fixtures being associated with all tests in the suite, which leads to multiple afterEach entries in the Tear Down section in the report. That was because we incorrectly assumed the following sequence of Mocha events:
onSuite onTest onHook (beforeEach) onHookEnd (beforeEach) onTestPassed onHook (afterEach) onHookEnd (afterEach) onTestEnd onSuiteEnd
The PR makes allure-mocha support the actual sequence:
onSuite onTest onHook (beforeEach) onHookEnd (beforeEach) onTestPassed onTestEnd onHook (afterEach) onHookEnd (afterEach) onSuiteEnd
This is done by storing the test's scope until onSuiteEnd, where scopes of all the suite's tests are written.
onSuiteEnd
Fix #236
Context
The PR fixes afterEach fixtures being associated with all tests in the suite, which leads to multiple afterEach entries in the Tear Down section in the report. That was because we incorrectly assumed the following sequence of Mocha events:
The PR makes allure-mocha support the actual sequence:
This is done by storing the test's scope until
onSuiteEnd
, where scopes of all the suite's tests are written.Fix #236
Checklist