Skip to content

Commit 926e6df

Browse files
committed
Stub RUNNER_NAME in unit tests
1 parent b1f1e7b commit 926e6df

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/config-utils.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ test.serial("load empty config", async (t) => {
144144
const logger = getRunnerLogger(true);
145145
const languages = "javascript,python";
146146

147+
setupActionsVars(tempDir, tempDir);
148+
147149
const codeql = createStubCodeQL({
148150
async betterResolveLanguages() {
149151
return {
@@ -185,6 +187,8 @@ test.serial("load code quality config", async (t) => {
185187
const logger = getRunnerLogger(true);
186188
const languages = "actions";
187189

190+
setupActionsVars(tempDir, tempDir);
191+
188192
const codeql = createStubCodeQL({
189193
async betterResolveLanguages() {
190194
return {
@@ -237,6 +241,8 @@ test.serial(
237241
const logger = getRunnerLogger(true);
238242
const languages = "javascript";
239243

244+
setupActionsVars(tempDir, tempDir);
245+
240246
const codeql = createStubCodeQL({
241247
async betterResolveLanguages() {
242248
return {
@@ -475,6 +481,8 @@ test.serial("load non-existent input", async (t) => {
475481

476482
test.serial("load non-empty input", async (t) => {
477483
return await withTmpDir(async (tempDir) => {
484+
setupActionsVars(tempDir, tempDir);
485+
478486
const codeql = createStubCodeQL({
479487
async betterResolveLanguages() {
480488
return {

src/testing-utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ export const DEFAULT_ACTIONS_VARS = {
156156
GITHUB_SERVER_URL: "https://github.com",
157157
GITHUB_SHA: "0".repeat(40),
158158
GITHUB_WORKFLOW: "test-workflow",
159+
RUNNER_NAME: "my-runner",
159160
RUNNER_OS: "Linux",
160161
} as const satisfies Record<string, string>;
161162

0 commit comments

Comments
 (0)