I'm adding playwright to my typescript/next.js app which already has jest/react-testing-library tests set up.
For now, I just want to add new Playwright e2e tests separately.
But when I run npm run test
as usual for my jest tests it fails because it tries running the Playwright tests which aren't fully compatible.
I feel like I've tried all the options to exclude the playwright files from jest but it never picks them up.
Any suggestions?
This thread is trying to answer question "How can I prevent Jest tests from running Playwright tests in a typescript/next.js app?"
We are having this problem only recently. When we added playwright we put the config at the root of our monorepo and just added all our tests into an e2e-tests
folder. Then adding "e2e-tests" to our testPathIgnorePatterns
setting in Jest made sure they never ran. In recent weeks Jest is now attemping to run all our playwright tests and we haven't changed any configuration.
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].