allure-framework / allure-js

Allure integrations for JavaScript test frameworks
https://allurereport.org/
Apache License 2.0
225 stars 120 forks source link

Allure-mocha: fix test result overwritten when a test is skipped dynamically #1015

Closed delatrie closed 3 months ago

delatrie commented 3 months ago

Context

If a test is skipped at runtime (with this.skip();), the test result gets overwritten, and all the data (links, labels, etc) is lost. In such cases, onTest is called before onPending so there is no need to create a new test result.

Also, we might want to implement a countermeasure of some sort (a warning or an error) if we dismiss the currently running test result.

Other changes

Fixes #457

Checklist