Skip to content

Commit 8bcdc8a

Browse files
committed
Fix test:view React.act is not a function errors in Copilot CLI
Copilot CLI runs shell commands with `NODE_ENV=production` in the environment, which leads to errors when validating its changes against the view tests, because the `React.act` function (used by `@testing-library/react` via `react-dom/test-utils`) is only exported when `NODE_ENV != production`.
1 parent f465109 commit 8bcdc8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extensions/ql-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2036,7 +2036,7 @@
20362036
"watch": "gulp watch",
20372037
"test": "npm-run-all test:*",
20382038
"test:unit": "cross-env TZ=UTC LANG=en-US NODE_OPTIONS=--no-experimental-strip-types jest --projects test/unit-tests",
2039-
"test:view": "cross-env NODE_OPTIONS=--no-experimental-strip-types jest --projects src/view",
2039+
"test:view": "cross-env NODE_ENV=test NODE_OPTIONS=--no-experimental-strip-types jest --projects src/view",
20402040
"test:vscode-integration": "npm-run-all test:vscode-integration:*",
20412041
"test:vscode-integration:activated-extension": "cross-env NODE_OPTIONS=--no-experimental-strip-types jest --projects test/vscode-tests/activated-extension",
20422042
"test:vscode-integration:no-workspace": "cross-env NODE_OPTIONS=--no-experimental-strip-types jest --projects test/vscode-tests/no-workspace",

0 commit comments

Comments
 (0)