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 an issue where a describe block will prevent a beforeEach call from executing #1294

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

jshayes
Copy link
Contributor

@jshayes jshayes commented Oct 12, 2024

What:

  • Bug Fix
  • New Feature

Description:

This PR fixes an issue where a describe block will prevent a parent describe block or a before each call from applying. This is due to the describing string being statically stored and set to null in the destructor. For example

describe('outer', function () {
    beforeEach(function () {});

    test('test1', function () {});

    describe('nested', function () {});

    test('test2', function () {});
});

The this example, the before each call will execute for test1 but not for test2. Also, the parent describe is not applied to test2. The following is the test output before and after this change

Before

string(11) "before each"

WARN  Text
! outer → test1 → This test did not perform any assertions
! test2 → This test did not perform any assertions

Tests:    2 risky (0 assertions)

After

string(11) "before each"
string(11) "before each"

WARN  Tests\Feature\TechnicianCapacityOverviewReportTest
! outer → test1 → This test did not perform any assertions
! outer → test2 → This test did not perform any assertions

Tests:    2 risky (0 assertions)

@jshayes jshayes mentioned this pull request Oct 12, 2024
2 tasks
@nunomaduro nunomaduro merged commit 0c57142 into pestphp:3.x Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants