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
Jest tests are slow #180
Comments
I just tried to setup mocha and run tests for my project and they passed in 222ms. I think it's big difference to 5sec |
Possibly related, jestjs/jest#116 |
I have to say I didn't liked jest, because I expected issues with auto mocking. I was using Mocha for years in my previous Este stack also with JSDOM, and it was super fast. Problem is all there requires in code aka mixing app wiring with app logic. In previous Este everything was testable because everywhere were a lot of small classes with DI container. But classes driven development sucks, as I recently realised with new functional Este approach. Every class is piece of mutable state without change history = debug hell. So now we have clean functional approach, but hard coded requires make code untestable. It's not a big issue, since testing is overrated and tests are a compensation mechanism for poor programming and incomplete and leaky abstractions. So we don't need testing everything, like classical class OOP needs. Still, sometimes TDD with unit tests is priceless. And for that use cases new Este will use Mocha with proper dependency injection without IOC container. Pure DI is enough http://blog.ploeh.dk/2014/06/10/pure-di/ |
Jest will be removed. |
I can confirm that fixing babel parser to skip |
Still, jsdom is deal breaker for Node 0.12 and what is worse, auto mocking is brittle and magic. |
I am testing react native, so auto mocking is actually my friend (React-Native provides lots of modules you can PS. I believe as per tests, what matters are the solid and reasonable use cases, not the framework being used :) But just leaving it here for anybody interested in using Jest. In case of any questions, feel free to shoot me a message via Gitter. |
I'm trying to write some basic tests using jest and I figured out that Jest is super slow.
I have three simple tests and running them takes 5 seconds.
When I clone este and run gulp jest, it takes ~1.4 sec, which is so much for running only one test for getrandomstring.js
I tried to google how to improve tests speed but I haven't found anything interesting. Lot of users recommends to use mocha instead of jest. They showed some benchmarks and mocha was running over 100 test in ~3 secs.
What do you think about mocha? Wouldn't it be better?
The text was updated successfully, but these errors were encountered: