Skip to content

Commit

Permalink
Add Jest 26 blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
cpojer committed May 2, 2020
1 parent 81fe06e commit 3551eb8
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions website/blog/2020-05-06-jest-26.md
@@ -0,0 +1,47 @@
---
title: Jest 26: Tick Tock
author: Christoph Nakazawa
authorURL: http://twitter.com/cpojer
authorFBID: 100000023028168
---

# Jest 26: Tick Tock

When we started rebuilding Jest five years ago our goal was to provide a batteries-included zero-configuration test runner that is approachable for beginners, extensible for almost all testing use cases and scalable to large projects. One of the most important releases was [Jest 15](https://jestjs.io/blog/2016/09/01/jest-15) which tied all the bits and pieces together and provided great defaults that allowed people to install and run Jest often without any setup. However, this approach has a big downside as Jest installs a lot of dependencies into your projects that you may not need.

We are now beginning to address this shortcoming and are working on reducing Jest’s install size while keeping it approachable and extensible. We have made the following breaking changes in Jest 26:

<!--truncate-->

* `[expect, jest-mock, pretty-format]` Remove `build-es5` from all packages ([#9945](https://github.com/facebook/jest/pull/9945))
* `[jest-config, jest-resolve]` Remove support for `browser` field ([#9943](https://github.com/facebook/jest/pull/9943))
* TypeScript definitions requires a minimum of TypeScript v3.8 ([#9823](https://github.com/facebook/jest/pull/9823))

With the above changes Jest 26 is now 4 MiB smaller than Jest 25.5.4 (53 → 49 MiB). Please keep in mind that many dependencies like Babel are likely already part of your project. Jest's own size was reduced by 1.2 MiB (4.3 -> 3.1 MiB).

While this is a good start, it isn’t enough to make Jest meaningfully leaner. We are planning on gradually reducing Jest's size by about 70%. Most of the changes to reduce Jest’s default setup will be small breaking changes and we want to bring the community with us as much as possible. Therefore we will make the following changes in Jest 27 and Jest 28 using a [“Tick-Tock" release process](https://en.wikipedia.org/wiki/Tick%E2%80%93tock_model):

* Jest 27 will ship with a new test runner (`jest-circus`), new fake timers with Lolex and the node.js environment by default. `jest-jasmine2`, the previous FakeTimers implementation and `jsdom` will still be bundled so users can keep using them by changing one-line each in the configuration.
* Jest 28 will remove `jest-jasmine2`, FakeTimers and `jsdom` from the default distribution of Jest. The packages will still be actively maintained as part of the Jest project and be published separately. Users will need to install these packages to use them.

Upon upgrading to these major releases, Jest will guide you through the necessary changes. If you’d like to get ahead and migrate to the new architecture now you can upgrade to Jest 26 and add the following configuration options:

```
TODO Simen/jeysal: configuration example
```

## Other Breaking Changes in Jest 26

* Dropped support for Node 8 ([#9423](https://github.com/facebook/jest/pull/9423))
* `[jest-environment-jsdom]` Upgrade `jsdom` to v16 ([#9606](https://github.com/facebook/jest/pull/9606))
* `[jest-runtime]` Remove long-deprecated `require.requireActual` and `require.requireMock` methods ([#9854](https://github.com/facebook/jest/pull/9854))
* `[jest-haste-map]` Removed `providesModuleNodeModules` ([#8535](https://github.com/facebook/jest/pull/8535))
* `[jest-circus]` Fail tests if a test takes a done callback and have return values ([#9129](https://github.com/facebook/jest/pull/9129))
* `[jest-circus]` Throw a proper error if a test / hooks is defined asynchronously ([#8096](https://github.com/facebook/jest/pull/8096))
* ***TODO***

## Stay Safe

We are all currently experiencing an unprecedented time in recent history. If you were recently laid off because of the ongoing pandemic and are struggling, we are happy to support you using [Jest’s OpenCollective fund](https://opencollective.com/jest). Check out this list of tasks and comment on the ones you’d like to work on to get started.

Please stay safe.

0 comments on commit 3551eb8

Please sign in to comment.