Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 25, 2024

Conversation

delatrie
Copy link
Collaborator

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

  • Issue template was added for allure-mocha.
  • The runner parameter is now added to allure-mocha test results (we test against three types of runners: the CLI runner and two code runners, in the CommonJS and ESM formats).

Fixes #457

Checklist

@delatrie delatrie added the type:bug Something isn't working label Jun 25, 2024
@github-actions github-actions bot added the theme:mocha Mocha related issue label Jun 25, 2024
@delatrie delatrie marked this pull request as ready for review June 25, 2024 09:53
@baev baev merged commit b60dad0 into main Jun 25, 2024
8 checks passed
@baev baev deleted the issue457-test-overwrite-fix branch June 25, 2024 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:mocha Mocha related issue type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[allure-mocha] - How can I add a label/epic/feature/story to a programmatically skipped test?
2 participants