Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

build: jest v27 #384

Merged
merged 2 commits into from
Sep 13, 2021
Merged

build: jest v27 #384

merged 2 commits into from
Sep 13, 2021

Conversation

ghost
Copy link

@ghost ghost commented Sep 11, 2021

Description

This PR upgrades Jest to v27 and the related deps.

Jest v27 uses by default "node" environment instead of "jsdom".

Running tests in a JSDOM environment incurs a significant performance overhead. Because this was the default behavior of Jest unless otherwise configured up until now, users who are writing Node apps, for example, may not even know they are given an expensive DOM environment that they do not even need.
For this reason, we are changing the default test environment from "jsdom" to "node". If you are affected by this change because you use DOM APIs and do not have the test environment explicitly configured, you should be receiving an error when e.g. document is accessed, and you can configure "testEnvironment": "jsdom" or use per-file environment configuration to resolve this.

To handle this change, it sets testEnvironment as jsdom in jest.config.js.

Motivation and Context

How has this been tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • Add tests to cover changes as needed.
  • Update documentation as needed.

@ghost ghost requested review from AmritKumar, bb111189, renlulu and teye as code owners September 11, 2021 08:15
@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2021

Codecov Report

Merging #384 (948dc37) into dev (5812a8d) will not change coverage.
The diff coverage is n/a.

❗ Current head 948dc37 differs from pull request most recent head 03ef0fc. Consider uploading reports for the commit 03ef0fc to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #384   +/-   ##
=======================================
  Coverage   80.98%   80.98%           
=======================================
  Files          44       44           
  Lines        1804     1804           
  Branches      329      329           
=======================================
  Hits         1461     1461           
  Misses        342      342           
  Partials        1        1           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5812a8d...03ef0fc. Read the comment docs.

@ghost ghost force-pushed the build/jest-v27 branch from 6a25870 to 03ef0fc Compare September 11, 2021 08:35
@bb111189 bb111189 merged commit 255e6cc into dev Sep 13, 2021
@bb111189 bb111189 deleted the build/jest-v27 branch September 13, 2021 06:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants