test: group remaining suite cleanups

This commit is contained in:
Peter Steinberger
2026-02-21 21:43:24 +00:00
parent 5c8f0b5a77
commit 861718e4dc
32 changed files with 870 additions and 922 deletions

View File

@@ -1,10 +1,16 @@
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { describe, expect, it } from "vitest";
import { beforeAll, describe, expect, it } from "vitest";
import { createDoctorRuntime, mockDoctorConfigSnapshot, note } from "./doctor.e2e-harness.js";
let doctorCommand: typeof import("./doctor.js").doctorCommand;
describe("doctor command", () => {
beforeAll(async () => {
({ doctorCommand } = await import("./doctor.js"));
});
it("warns when the state directory is missing", async () => {
mockDoctorConfigSnapshot();
@@ -13,7 +19,6 @@ describe("doctor command", () => {
process.env.OPENCLAW_STATE_DIR = missingDir;
note.mockClear();
const { doctorCommand } = await import("./doctor.js");
await doctorCommand(createDoctorRuntime(), {
nonInteractive: true,
workspaceSuggestions: false,
@@ -38,7 +43,6 @@ describe("doctor command", () => {
},
});
const { doctorCommand } = await import("./doctor.js");
await doctorCommand(createDoctorRuntime(), {
nonInteractive: true,
workspaceSuggestions: false,
@@ -63,7 +67,6 @@ describe("doctor command", () => {
note.mockClear();
try {
const { doctorCommand } = await import("./doctor.js");
await doctorCommand(createDoctorRuntime(), {
nonInteractive: true,
workspaceSuggestions: false,