playwright-community / jest-playwright

Running tests using Jest & Playwright
MIT License
532 stars 75 forks source link

Support Jest 29 #809

Closed tbouffard closed 1 year ago

tbouffard commented 2 years ago

Is your feature request related to a problem? Please describe. If I declare jest@29 as dependency of my project and use jest-playwright-preset@2.0.0, I get an error message when running npm install

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: jest-playwright-preset@2.0.0
npm ERR! Found: jest@29.2.2
npm ERR! node_modules/jest
npm ERR!   dev jest@"~29.2.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer jest@"^28.0.0" from jest-playwright-preset@2.0.0

Describe the solution you'd like Be able to use Jest 29 out of the box.

Describe alternatives you've considered Current workaround when using npm

Additional context Jest 29 doesn't introduce large breaking changes (unlike jest 28): https://jestjs.io/blog/2022/08/25/jest-29 It drops supports for Node 12 and 17. This doesn't impact jest-playright@2.0.0 that requires Node 14+

tbouffard commented 2 years ago

I guess that declaring "jest": "^28.0.0 || ^29.0.0" in peerDependencies will fix my issue. Has anyone else tried jest-playwright with jest@29?

I can submit a Pull Request if others confirm it works.

mxschmitt commented 1 year ago

This should be fixed now in v3 of this NPM package.

https://github.com/playwright-community/jest-playwright/releases/tag/v3.0.0