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

Breaks tests #18

Open
stebogit opened this issue Oct 10, 2022 · 1 comment
Open

Breaks tests #18

stebogit opened this issue Oct 10, 2022 · 1 comment

Comments

@stebogit
Copy link

Hey, I'm using the Api class in my routes/api.php file, but that broke my tests as if no routes were defined, e.g.

Symfony\Component\Routing\Exception\RouteNotFoundException : Route [api.weather.daily] not defined.

I tried building the Api resources before or after the Route:: definitions, but the result is the same; I have to skip the swagger stuff if the tests are running

if (!app()->environment('testing')) {
    Api::get('/some', [ApiController::class, 'some']);
    ...
}

Any clue?

Using version 1.4.0 on Laravel 9.x.

@stebogit
Copy link
Author

Actually, after further playing around with it it seems the Api definitions actually break the Auth pattern, that is the Sanctum guard is skipped entirely.

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

No branches or pull requests

2 participants
@stebogit and others