Skip to content

Commit 509d9fb

Browse files
mlahargouclaude
andcommitted
fix: mock config-loader in tests to avoid missing config.js
config-loader.js dynamically imports config.js which only exists after deployment. Mock it in tests since the utility functions under test don't depend on config. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent abb3973 commit 509d9fb

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/utils.test.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
import { describe, it, expect } from "vitest";
2-
import utils from "./utils.js";
1+
import { describe, it, expect, vi } from "vitest";
2+
3+
vi.mock("./config-loader.js", () => ({
4+
default: { repos: [] },
5+
}));
6+
7+
const { default: utils } = await import("./utils.js");
38

49
describe("mapCheckToStatus", () => {
510
it("maps in_progress to pending", () => {

0 commit comments

Comments
 (0)