Skip to content

Commit

Permalink
chore: jest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Apr 29, 2020
1 parent 37d1121 commit b9cf421
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -197,6 +197,7 @@
"@types/github-url-from-git": "1.5.0",
"@types/global-agent": "2.1.0",
"@types/got": "9.6.10",
"@types/graceful-fs": "4.1.3",
"@types/ini": "1.3.30",
"@types/jest": "25.2.1",
"@types/js-yaml": "3.12.3",
Expand Down
@@ -1,11 +1,11 @@
diff --git a/node_modules/jest-runtime/build/index.js b/node_modules/jest-runtime/build/index.js
index 0c9dd8c..58109b5 100644
index 0080697..e60da58 100644
--- a/node_modules/jest-runtime/build/index.js
+++ b/node_modules/jest-runtime/build/index.js
@@ -1189,7 +1189,38 @@ class Runtime {
@@ -1274,7 +1274,38 @@ class Runtime {
return this._getMockedNativeModule();
}

- return require(moduleName);
+ // return require(moduleName);
+ if (!this._coreModulesProxyCache) {
Expand Down Expand Up @@ -40,5 +40,5 @@ index 0c9dd8c..58109b5 100644
+
+ return this._coreModulesProxyCache[moduleName] = new Proxy(mod, {set});
}

_importCoreModule(moduleName, context) {
3 changes: 3 additions & 0 deletions tools/package.json
Expand Up @@ -12,5 +12,8 @@
"lodash": "4.17.15",
"shelljs": "0.8.4",
"strip-ansi": "6.0.0"
},
"devDependencies": {
"@types/graceful-fs": "4.1.3"
}
}
7 changes: 7 additions & 0 deletions yarn.lock
Expand Up @@ -1452,6 +1452,13 @@
"@types/tough-cookie" "*"
form-data "^2.5.0"

"@types/graceful-fs@4.1.3":
version "4.1.3"
resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.3.tgz#039af35fe26bec35003e8d86d2ee9c586354348f"
integrity sha512-AiHRaEB50LQg0pZmm659vNBb9f4SJ0qrAnteuzhSeAUcJKxoYgEnprg/83kppCnc2zvtCKbdZry1a5pVY3lOTQ==
dependencies:
"@types/node" "*"

"@types/ini@1.3.30":
version "1.3.30"
resolved "https://registry.yarnpkg.com/@types/ini/-/ini-1.3.30.tgz#d1485459c9fad84e937414b832a2adb649eab379"
Expand Down

0 comments on commit b9cf421

Please sign in to comment.