Skip to content

Commit dec44fe

Browse files
committed
Try to fix tests in CI (they work locally)
1 parent db16877 commit dec44fe

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

jest.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ module.exports = {
3434
transformIgnorePatterns: [
3535
"node_modules/(?!(@modelcontextprotocol|delay|p-wait-for|globby|serialize-error|strip-ansi|default-shell|os-name)/)",
3636
],
37+
roots: ["<rootDir>/src", "<rootDir>/webview-ui/src"],
3738
modulePathIgnorePatterns: [".vscode-test"],
3839
reporters: [["jest-simple-dot-reporter", {}]],
3940
setupFiles: [],

src/integrations/checkpoints/__tests__/LocalCheckpointer.test.ts

+8-10
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ describe("LocalCheckpointer", () => {
1414
let git: SimpleGit
1515
let testFile: string
1616
let initialCommit: CommitResult
17+
const mainBranch = "my_branch"
18+
const hiddenBranch = "checkpoints"
1719

1820
beforeEach(async () => {
1921
// Create a temporary directory for testing.
2022
tempDir = path.join(os.tmpdir(), `checkpointer-test-${Date.now()}`)
2123
await fs.mkdir(tempDir)
22-
console.log(tempDir)
2324

2425
// Initialize git repo.
2526
git = simpleGit(tempDir)
26-
await git.init()
27+
await git.init(["--initial-branch", mainBranch])
2728
await git.addConfig("user.name", "Roo Code")
2829
await git.addConfig("user.email", "[email protected]")
2930

@@ -36,11 +37,7 @@ describe("LocalCheckpointer", () => {
3637
initialCommit = await git.commit("Initial commit")!
3738

3839
// Create checkpointer instance.
39-
checkpointer = await LocalCheckpointer.create({
40-
workspacePath: tempDir,
41-
mainBranch: "main",
42-
hiddenBranch: "checkpoints",
43-
})
40+
checkpointer = await LocalCheckpointer.create({ workspacePath: tempDir, mainBranch, hiddenBranch })
4441
})
4542

4643
afterEach(async () => {
@@ -49,8 +46,9 @@ describe("LocalCheckpointer", () => {
4946
})
5047

5148
it("creates a hidden branch on initialization", async () => {
52-
const branches = await git.branch()
53-
expect(branches.all).toContain("checkpoints")
49+
const { all: branches } = await git.branch()
50+
expect(branches).toContain(mainBranch)
51+
expect(branches).toContain(hiddenBranch)
5452
})
5553

5654
it("saves and lists checkpoints", async () => {
@@ -61,7 +59,7 @@ describe("LocalCheckpointer", () => {
6159
expect(commit?.commit).toBeTruthy()
6260

6361
const checkpoints = await checkpointer.listCheckpoints()
64-
expect(checkpoints.length).toBeGreaterThan(0)
62+
expect(checkpoints.length).toBe(2)
6563
expect(checkpoints[0].message).toBe(commitMessage)
6664
expect(checkpoints[0].hash).toBe(commit?.commit)
6765
})

0 commit comments

Comments
 (0)