Add and use __CODEQL_ACTION_TEST_ENV__ in tests

This commit is contained in:
Michael B. Gale
2026-10-08 20:17:42 +01:00
parent d6196d8703
commit bd97dda6bf
6 changed files with 22 additions and 9 deletions

View File

@@ -184,12 +184,6 @@ export function makeMacro<Args extends unknown[]>(
}
export function getTestEnv(testEnv: NodeJS.ProcessEnv = {}): Env {
// In unit tests run by `ava`, this environment variable is set for the process,
// but we default to an empty environment here for `testEnv`, so we must set it
// explicitly to ensure that we get test-specific behaviour in functions when
// we need it.
testEnv["NODE_ENV"] = "test";
return getEnv(testEnv);
}