Zilliqa / zilliqa-js

JavaScript SDK for Zilliqa blockchain
https://www.npmjs.com/package/@zilliqa-js/zilliqa
GNU General Public License v3.0
131 stars 74 forks source link

build: jest v27 #384

Closed ghost closed 3 years ago

ghost commented 3 years ago

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

Checklist:

codecov-commenter commented 3 years ago

Codecov Report

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

:exclamation: 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.