Summer Sale! All accounts are 50% off this week.

mozex's avatar
Level 16

Testing a URL that does not exist in routes

Hi, I have a folder called docs in my public folder. I am trying to write a test to check if the status is 200 and if it is correctly being redirected to the correct version, but as I understand, the $this->get('/docs') does not work because it is looking for a route inside the app, so is there any way that I can make this work?

0 likes
8 replies
mozex's avatar
Level 16

@Sinnbeck I am using Vuepress for my documentation, and I set the build folder of it in the public folder so it can be accessible.

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@mozex Then it sounds more like an e2e test as you need to actually call that url. So either cypress or laravel Dusk

Sinnbeck's avatar

@mozex How are you making the redirect? Maybe you can write the test in that language.

mozex's avatar
Level 16

@Sinnbeck It is being handled by javascript, but I think the best solution would be Dusk or Cypress.

tykus's avatar

What are you actually testing here?

mozex's avatar
Level 16

@tykus I want to test if the folder exists and redirects to the correct version and make sure some content exists because generating docs is part of the deployment. I need to test it to make sure it works fine.

Please or to participate in this conversation.