From 8bcdc8a066beff225d0c27d9915ea77cfaabae16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nora=20Dimitrijevi=C4=87?= Date: Mon, 9 Feb 2026 13:00:26 +0100 Subject: [PATCH] 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`. --- extensions/ql-vscode/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/ql-vscode/package.json b/extensions/ql-vscode/package.json index 457517a66e2..747db220b9b 100644 --- a/extensions/ql-vscode/package.json +++ b/extensions/ql-vscode/package.json @@ -2036,7 +2036,7 @@ "watch": "gulp watch", "test": "npm-run-all test:*", "test:unit": "cross-env TZ=UTC LANG=en-US NODE_OPTIONS=--no-experimental-strip-types jest --projects test/unit-tests", - "test:view": "cross-env NODE_OPTIONS=--no-experimental-strip-types jest --projects src/view", + "test:view": "cross-env NODE_ENV=test NODE_OPTIONS=--no-experimental-strip-types jest --projects src/view", "test:vscode-integration": "npm-run-all test:vscode-integration:*", "test:vscode-integration:activated-extension": "cross-env NODE_OPTIONS=--no-experimental-strip-types jest --projects test/vscode-tests/activated-extension", "test:vscode-integration:no-workspace": "cross-env NODE_OPTIONS=--no-experimental-strip-types jest --projects test/vscode-tests/no-workspace",