mirror of
https://github.com/github/codeql-action.git
synced 2026-10-30 01:27:22 +00:00
Allow initializeEnvironment to accept Env
This commit is contained in:
@@ -5,7 +5,7 @@ import * as sinon from "sinon";
|
||||
|
||||
import * as actionsUtil from "../actions-util";
|
||||
import { ActionsEnvVars } from "../environment";
|
||||
import { callee, setupTests } from "../testing-utils";
|
||||
import { callee, getTestEnv, setupTests } from "../testing-utils";
|
||||
import { initializeEnvironment } from "../util";
|
||||
|
||||
import { getCodeQLActionRepository } from "./repository";
|
||||
@@ -13,13 +13,14 @@ import { getCodeQLActionRepository } from "./repository";
|
||||
setupTests(test);
|
||||
|
||||
test.serial("getCodeQLActionRepository", async (t) => {
|
||||
initializeEnvironment("1.2.3");
|
||||
const initialEnv = getTestEnv({
|
||||
[ActionsEnvVars.RUNNER_TEMP]: path.dirname(__dirname),
|
||||
});
|
||||
initializeEnvironment("1.2.3", initialEnv);
|
||||
|
||||
const target = callee(getCodeQLActionRepository)
|
||||
.withArgs()
|
||||
.withEnv((env) => {
|
||||
env.set(ActionsEnvVars.RUNNER_TEMP, path.dirname(__dirname));
|
||||
});
|
||||
.withEnv(initialEnv);
|
||||
|
||||
// isRunningLocalAction() === true
|
||||
await target.passes(t.deepEqual, "github/codeql-action");
|
||||
|
||||
Reference in New Issue
Block a user