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]: Pest does not find the route #1321

Open
adrianbeniel opened this issue Nov 23, 2024 · 0 comments
Open

[Bug]: Pest does not find the route #1321

adrianbeniel opened this issue Nov 23, 2024 · 0 comments
Labels

Comments

@adrianbeniel
Copy link

What Happened

Hi, I am using Laravel 11 with Sail for local development and I run the tests through the containers (sail artisan test).

The problem that only the first test that is executed finds the indicated route, even if they are the same.
The second tests returns a 404 error from the ->get().

How to Reproduce

  • Install Laravel 11
  • Create a route to return something
  • Use Pest to test that route two times:
it('test 1', function () {
    $this->get('test')->assertStatus(200);
});

it('test 2', function () {
    $this->get('test')->assertStatus(200);
});

Result:

sail artisan test

FAIL  Tests\Feature\Api\Home\HomeControllerTest
✓ it test 1                                                                                                                                                                                                 
⨯ it test 2 <-- Error 404

if I run one by one, it works without problems:

sail artisan test --filter="Test 1"

PASS  Tests\Feature\Api\Home\HomeControllerTest
✓ it test 1 
sail artisan test --filter="Test 2"

PASS  Tests\Feature\Api\Home\HomeControllerTest
✓ it test 2  

Also using --parallel we have the same issue.

Sample Repository

No response

Pest Version

3.5.1

PHP Version

8.3.4

Operation System

Linux

Notes

No response

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