Skip to content

Commit 5138831

Browse files
authored
Merge pull request #1852 from github/koesie10/fix-vscode-1.74.0
Fix failing tests on VSCode 1.74.0
2 parents 993b8c9 + 484c7db commit 5138831

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

extensions/ql-vscode/patches/jest-runner-vscode+3.0.1.patch

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
diff --git a/node_modules/jest-runner-vscode/dist/child/environment.js b/node_modules/jest-runner-vscode/dist/child/environment.js
2+
index 1ac28d5..f91f216 100644
3+
--- a/node_modules/jest-runner-vscode/dist/child/environment.js
4+
+++ b/node_modules/jest-runner-vscode/dist/child/environment.js
5+
@@ -10,6 +10,21 @@ const wrap_io_1 = __importDefault(require("./wrap-io"));
6+
const load_pnp_1 = __importDefault(require("./load-pnp"));
7+
const ipc = new ipc_client_1.default('env');
8+
class VSCodeEnvironment extends jest_environment_node_1.default {
9+
+ constructor(config, context) {
10+
+ super(config, context);
11+
+ // The _VSCODE_NODE_MODULES is a proxy which will require a module if any property
12+
+ // on it is accessed. This is a workaround for the fact that jest will call
13+
+ // _isMockFunction on the module, which will cause that function to be required.
14+
+ this.global._VSCODE_NODE_MODULES = new Proxy(this.global._VSCODE_NODE_MODULES, {
15+
+ get(target, prop) {
16+
+ if (prop === '_isMockFunction') {
17+
+ return undefined;
18+
+ }
19+
+ return target[prop];
20+
+ },
21+
+ });
22+
+ }
23+
+
24+
async setup() {
25+
await super.setup();
26+
await (0, load_pnp_1.default)();
127
diff --git a/node_modules/jest-runner-vscode/dist/child/runner.js b/node_modules/jest-runner-vscode/dist/child/runner.js
228
index 0663c5c..4991663 100644
329
--- a/node_modules/jest-runner-vscode/dist/child/runner.js

0 commit comments

Comments
 (0)