Skip to content
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

fix(allure-jest): beforeEach/afterEach affect all tests in the suite, beforeAll/afterAll don't affect tests in sub-suites #1052

Merged
merged 2 commits into from
Jul 8, 2024

Conversation

delatrie
Copy link
Collaborator

@delatrie delatrie commented Jul 8, 2024

Context

The PR fixes two defects in allure-jest hooks:

  1. beforeEach and afterEach hooks are reported for all tests in the suite.
    In the following example, the tests receive two fixtures each:
    beforeEach(() => {});
    it("foo", () => {});
    it("bar", () => {});
  2. beforeAll and afterAll hooks aren't reported for tests in the sub-suites.
    In the following example, the test receives no fixture:
    beforeAll(() => {});
    describe("foo", () => {
        it("bar", () => {});
    });

Checklist

@delatrie delatrie added the type:bug Something isn't working label Jul 8, 2024
@delatrie delatrie requested a review from baev July 8, 2024 11:51
@github-actions github-actions bot added the theme:jest Jest related issue label Jul 8, 2024
@delatrie delatrie force-pushed the fix-jest-fixtures branch from 7534830 to 1d62f82 Compare July 8, 2024 11:56
@delatrie delatrie marked this pull request as ready for review July 8, 2024 11:56
@delatrie delatrie merged commit bb14e6b into main Jul 8, 2024
8 checks passed
@delatrie delatrie deleted the fix-jest-fixtures branch July 8, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:jest Jest related issue type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants