No tests found when directory name has `[` or `]` (Component Testing with Next.js)
See original GitHub issueCurrent behavior
Hello, I was set up Cypress Component Testing with Next.js plugin. I encountered No tests found.
error.
I’m writing exactly the same code for these two files. But different behavior. I investigated below
some/foo.spec.js
=> workssome/[thing]/foo.spec.js
=> No tests foundsome/[thing/foo.spec.js
=> No tests foundsome/thing]/foo.spec.js
=> No tests found
[thing]
style is used in Next.js pages directory. Is it possible to fix this issue?
Thanks
Desired behavior
some/foo.spec.js
=> workssome/[thing]/foo.spec.js
=> workssome/[thing/foo.spec.js
=> workssome/thing]/foo.spec.js
=> works
Test code to reproduce
It can reproduce minimum Component Testing with Next.js. Just put [
or ]
in directory name.
Cypress Version
9.5.1
Other
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Component Testing with Next.js: No tests found #17883 - GitHub
I'm having some trouble getting Component Tests setup with Next.js. Running npx cypress open-ct will open the Test Runner and identify the ...
Read more >Testing | Next.js
Learn how to set up Next.js with three commonly used testing tools — Cypress, Playwright, Jest, and React Testing Library.
Read more >No Test File but NextJs still display this `When testing, code ...
I am wondering where this error message is coming from. I scanned for all test-related files. **.test.tsx, **.test.js and *.spec.tsx etc.
Read more >How to test your Next.js pages and components with Jest
One such tool is React Testing Library, an open-source tool that I'm going to walk you through setting up and using with your...
Read more >Putting test files in the pages folder in a Next.js app
How to include test and other non-page files next to page components and API routes within the pages directory in a Next.js application....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I looked into it. It’s only happening with webpack-dev-server, not vite-dev-server. So, this isn’t a Next.js specific thing, but just a webpack-dev-server thing. I will continue looking into this.
Nice, thanks for the confirmation!