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

[Bug]: beforeEach runs even when skipped #1329

Open
hulkur opened this issue Dec 17, 2024 · 0 comments
Open

[Bug]: beforeEach runs even when skipped #1329

hulkur opened this issue Dec 17, 2024 · 0 comments
Labels

Comments

@hulkur
Copy link

hulkur commented Dec 17, 2024

What Happened

beforeEach runs before checking skip() both when on test or directly on beforeEach.

I would expect that skip check takes precedence.

How to Reproduce

beforeEach(fn () => dump('beforeEach'))
    ->skip(fn () => dump('skip'));

test('should not run', fn () => dump('this test should not run'));

output:

"beforeEach" // tests\Feature\Api\pestTest.php:3
"skip" // tests\Feature\Api\pestTest.php:4

This test was ignored.

Sample Repository

No response

Pest Version

3.7.1

PHP Version

8.3.14

Operation System

Windows

Notes

in case it's significant: Pest in Laravel app

@hulkur hulkur added the bug label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant