jest-environment-jsdom-latest
TypeScript icon, indicating that this package has built-in type declarations

26.6.2 • Public • Published

jest-environment-jsdom-latest

npm version stability-stable npm minzipped size dependencies types Conventional Commits styled with prettier linted with eslint license

Jest environment to use the latest jsdom API and features.

paypal coinbase twitter

Installation

npm install jest-environment-jsdom-latest

Usage

In index.spec.js or whatever:

/**
 * @jest-environment jsdom-latest
 */

test('use the latest jsdom features in this test file', () => {
  const element = document.createElement('div');
  expect(element).not.toBeNull();
});

Motivation

As of v10, jsdom has a new API and some cool new features. The downside is that now it requires a Node version >= 6.

As stated in the Jest documentation (here), the minimum supported Node version is v4.0.0.

This package helps you if you are running on Node >= 6 and want to use the latest JSDOM features. It will be deprecated when Jest drops Node 4 and Node 5 support.

The build script is as close as possible from the one of Facebook's Jest repo. More on Jest environments: http://facebook.github.io/jest/docs/configuration.html#testenvironment-string

License

MIT. See license file.

/jest-environment-jsdom-latest/

    Package Sidebar

    Install

    npm i jest-environment-jsdom-latest

    Weekly Downloads

    338

    Version

    26.6.2

    License

    MIT

    Unpacked Size

    116 kB

    Total Files

    7

    Last publish

    Collaborators

    • dmnsgn