-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Use jest-matchers for assertions instead of expect #5027
Conversation
feee850
to
7b3f9c6
Compare
And for the browser-based tests, those run on karma and mocha, so should we be switching to jest-matchers (which are presumably built for node) for tests that need a DOM anyways? |
If you want node test you can basically just run Jest (that internally sets up Jest matchers). I can do another PR showing this... will remove a lot of confirguration. |
Well, it's more that I'm thinking this should only apply to DOM-less packages (react-router, react-router-native, react-router-redux, react-router-config). Basically everything except react-router-dom. |
I'd love to just convert everything over to using Jest and ditch all of our custom karma + (flaky) BrowserStack integration. The |
I'd be totally down with that. react-router-redux already uses it and it works great. |
@mjackson glad to hear this and thanks for letting me use this repo for testing jest-codemods. ; ) |
Currently [email protected] is being integrated into Jest (see more background in jestjs/jest#1679).
In jest-codemods I'm working on a codemod to automate the process of going from mjackson/expect to jest-matchers (if running in a browser) or plain Jest (if running in node). 🤖
I've tested the codemod on this project and everything should still work.
Let me know what you think.
Blocked: currently fails in older browsers 💣
Seems like jest-matchers have untranspiled code
SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.
.Will look into a solution for this.