Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
New defaults for Jest. #1511
For Jest 15 we are going to ship with a ton of new defaults that should make the experience of using Jest better. With this, I also removed a bunch of outdated documentation from the website – however I feel like we should completely rewrite the documentation on the website and replace it with better, useful, step-by-step guides (cc @lacker).
At Facebook we will continue to use automocking and fake timers for the foreseeable future and both features will continue to be part of Jest long term. Especially the auto mocking feature at this point is easy to maintain and the explicit auto-mocking using
TODO: I'll add a few tests for the new errors tomorrow :)
Excited for this release! Looking forward to new docs, too. I just picked up jest for a new personal project (via create-react-app#master) and it wasn't clear to me if I was supposed to require at top-level or within test cases (or in beforeEach), how jest.doMock will affect future test runs, whether a mock will persist outside the describe it was defined in, etc. I think a page giving a high-level overview of when jest will mock modules and how that works would help with that a ton.
Current coverage is 63.09% (diff: 47.27%)
@@ master #1511 diff @@ ========================================== Files 97 97 Lines 3647 3647 Methods 0 0 Messages 0 0 Branches 0 0 ========================================== + Hits 2292 2301 +9 + Misses 1355 1346 -9 Partials 0 0