Skip to content

Commit

Permalink
Patch jest-environment-node
Browse files Browse the repository at this point in the history
Sometimes the env was torn down when it was still needed by dynamic imports.
  • Loading branch information
nicolo-ribaudo committed Sep 1, 2021
1 parent 30f6da8 commit a7fcffb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .yarn/patches/jest-environment-node.patch
@@ -0,0 +1,13 @@
diff --git a/build/index.js b/build/index.js
index c3ff0a86f659f678280bed4e511f5dd145b64939..65e1ff670bed80f9095b9dd170846455a71a2b89 100644
--- a/build/index.js
+++ b/build/index.js
@@ -150,7 +150,7 @@ class NodeEnvironment {
this.fakeTimersModern.dispose();
}

- this.context = null;
+ //this.context = null;
this.fakeTimers = null;
this.fakeTimersModern = null;
}
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -89,7 +89,8 @@
"@types/babel__core": "link:./nope",
"@types/babel__traverse": "link:./nope",
"@babel/parser/@babel/types": "workspace:*",
"babel-plugin-polyfill-corejs2/@babel/compat-data": "workspace:*"
"babel-plugin-polyfill-corejs2/@babel/compat-data": "workspace:*",
"jest-environment-node": "patch:jest-environment-node@^27.0.1#./.yarn/patches/jest-environment-node.patch"
},
"engines": {
"yarn": ">=1.4.0"
Expand Down
16 changes: 15 additions & 1 deletion yarn.lock
Expand Up @@ -10162,7 +10162,7 @@ fsevents@^1.2.7:
languageName: node
linkType: hard

"jest-environment-node@npm:^27.0.1":
jest-environment-node@^27.0.1:
version: 27.0.1
resolution: "jest-environment-node@npm:27.0.1"
dependencies:
Expand All @@ -10176,6 +10176,20 @@ fsevents@^1.2.7:
languageName: node
linkType: hard

"jest-environment-node@patch:jest-environment-node@^27.0.1#./.yarn/patches/jest-environment-node.patch::locator=babel%40workspace%3A.":
version: 27.0.1
resolution: "jest-environment-node@patch:jest-environment-node@npm%3A27.0.1#./.yarn/patches/jest-environment-node.patch::version=27.0.1&hash=931cdf&locator=babel%40workspace%3A."
dependencies:
"@jest/environment": ^27.0.1
"@jest/fake-timers": ^27.0.1
"@jest/types": ^27.0.1
"@types/node": "*"
jest-mock: ^27.0.1
jest-util: ^27.0.1
checksum: feefdcca74e117f671c22651b52318bcf67322817489a8bca8a73b8d258330a26f8ab466d1d399b49dc2941029c7298c7dacfd0174505ffbd1a10465ebb6a538
languageName: node
linkType: hard

"jest-get-type@npm:^25.2.6":
version: 25.2.6
resolution: "jest-get-type@npm:25.2.6"
Expand Down

0 comments on commit a7fcffb

Please sign in to comment.