Jest comes with jsdom to mount your components. When you mount your component with render libs like
enzyme, this component will be mounted on jsdom.
Like your browser, you need to keep jsdom up-to-date to get the last implementations of it.
Unfortunately, Jest@24 comes with jsdom’s 11 version for compatibility reasons:
Note: Jest comes with JSDOM@11 by default. Due to JSDOM 12 and newer dropping support for Node 6, Jest is unable to upgrade for the time being.
At the time of writing this, jsdom is already on 15 version. There are lots of new features over the version 11.
For install the most recent version, all you have to do is:
- Install the most recent jsdom environment:
yarn add jest-environment-jsdom-fifteen --dev
- Configure Jest to use it. In in your