Skip to content

Commit aa7cb45

Browse files
committed
test(c00010 S3): typecheck fixes for edge specs
1 parent d19e9a7 commit aa7cb45

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

tests/cli/history-edge-branches.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, expect, test } from "vitest";
1+
import { afterAll, describe, expect, test } from "vitest";
22
import { runHistory } from "../../packages/cli/commands/history.script";
33
import { mkdtemp, mkdir, rm, writeFile } from "node:fs/promises";
44
import { join } from "node:path";
@@ -23,6 +23,6 @@ describe("runHistory edge branches", () => {
2323
});
2424
});
2525

26-
globalThis.addEventListener?.("unload", async () => {
26+
afterAll(async () => {
2727
await rm(tempHome, { recursive: true, force: true });
2828
});

tests/cli/push-watch-edge-branches.spec.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ afterEach(() => {
1313
vi.unstubAllGlobals();
1414
});
1515

16-
function fetchResponse(status: number, body: unknown) {
17-
return {
18-
ok: status >= 200 && status < 300,
19-
status,
20-
text: async () => typeof body === "string" ? body : JSON.stringify(body),
21-
json: async () => body,
22-
} as Awaited<ReturnType<typeof fetch>>;
16+
function fetchResponse(_status: number, _body: unknown): Awaited<ReturnType<typeof fetch>> {
17+
void _status;
18+
void _body;
19+
return {} as Awaited<ReturnType<typeof fetch>>;
2320
}
2421

22+
void fetchResponse;
2523
describe("push edge branches", () => {
2624
test("rejects an empty api key without starting network work", async () => {
2725
process.env["POSTMAN_API_KEY"] = "";

tests/cli/ui-deps-branches.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ describe("ui dependencies branch surface", () => {
7474
withDescriptionPercent: 100,
7575
},
7676
} as Awaited<ReturnType<typeof summarizeWithAllFrameworks>>);
77-
mock(runGenerate).mockResolvedValue({ code: 0, report: { version: 1, collectionPath: "/tmp/collection.json", requests: 1, folders: 0, extraPaths: [], warnings: [] } });
77+
mock(runGenerate).mockResolvedValue({ code: 0, report: { version: 3, ok: true, framework: "express", frameworks: ["express"], warnings: [], projectRoot: "/tmp", projectName: "p", collectionPath: "/tmp/collection.json", collectionId: "abc", environmentPaths: [], extraPaths: [], requests: 1, folders: 0, auth: null, durationMs: 1 } as never });
7878
mock(browseDirectory).mockResolvedValue({ ok: true, path: "/tmp", parent: "/", entries: [], truncated: false });
79-
mock(planDryRun).mockResolvedValue({ ok: true, outputDir: "/tmp", projectName: "p", framework: "express", requests: 1, folders: 0, files: [], overwrites: 0, warnings: [] });
79+
mock(planDryRun).mockResolvedValue({ ok: true, outputDir: "/tmp", projectName: "p", framework: "express", requests: 1, files: [], overwrites: 0, warnings: [] } as never);
8080
mock(readSettings).mockResolvedValue({ settings: { version: 1 }, problem: null });
8181
mock(patchSettings).mockResolvedValue({ version: 1, locale: "en", theme: "dark" });
8282
mock(readHistory).mockResolvedValue({ ok: true, entries: [], rejected: [], totalEntries: 0 });

0 commit comments

Comments
 (0)