test: fix failing tests

swadhinbiswas committed 3 months ago
c4c4ada
1 parent e3bd4a1
commit c4c4ada
4 files changed
+8 -5
▼cli/src/smoke.test.ts
+1-1
23
23
if (error?.code === 'EPERM') return;
24
24
throw error;
25
25
}
26
- expect(output).toContain('OpenCodeHub CLI');
26
+ expect(output).toContain('OCH CLI');
27
27
expect(output).toContain('Usage: och');
28
28
});
29
29
30
30
▼tests/unit/health-route.test.ts
+3-3
9
9
const rawQueryMock = vi.hoisted(() => vi.fn(async () => [{ "?column?": 1 }]));
10
10
const fsAccessMock = vi.hoisted(() => vi.fn(async () => undefined));
11
11
12
-vi.mock("@/db", () => ({
13
- getDatabase: () => ({
14
- execute: rawQueryMock,
12
+vi.mock("@/db/adapter", () => ({
13
+ getDb: () => ({
14
+ rawQuery: rawQueryMock,
15
15
}),
16
16
}));
17
17
18
18
▼tests/unit/merge-gates.test.ts
+1-1
99
99
100
100
const result = await canMerge("pr1");
101
101
expect(result.canMerge).toBe(false);
102
- expect(result.reason).toContain('Required status check "build"');
102
+ expect(result.reason).toContain("Required status check 'build'");
103
103
});
104
104
105
105
it("blocks when external CI is still running", async () => {
106
106
▼tests/unit/openapi-pulls-parity.test.ts
+3-0
54
54
"/repos/{}/{}/pulls/bulk-queue-manage",
55
55
"/repos/{}/{}/pulls/bulk-queue",
56
56
"/repos/{}/{}/pulls/review-health",
57
+ "/repos/{}/{}/pulls/{}/code-quality",
58
+ "/repos/{}/{}/pulls/{}/comments/apply-suggestion",
59
+ "/repos/{}/{}/pulls/{}/ai-suggestions/{}/apply",
57
60
]);
58
61
59
62
const missing = expectedPaths.filter(
60
63