mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-15 19:21:08 +00:00
test: narrow doctor command warning coverage
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { withTempHomeConfig } from "../config/test-helpers.js";
|
||||
import { note } from "../terminal/note.js";
|
||||
import { noteIncludeConfinementWarning } from "./doctor-config-analysis.js";
|
||||
|
||||
vi.mock("../terminal/note.js", () => ({
|
||||
note: vi.fn(),
|
||||
}));
|
||||
|
||||
import { loadAndMaybeMigrateDoctorConfig } from "./doctor-config-flow.js";
|
||||
|
||||
const noteSpy = vi.mocked(note);
|
||||
|
||||
describe("doctor include warning", () => {
|
||||
it("surfaces include confinement hint for escaped include paths", async () => {
|
||||
await withTempHomeConfig({ $include: "/etc/passwd" }, async () => {
|
||||
await loadAndMaybeMigrateDoctorConfig({
|
||||
options: { nonInteractive: true },
|
||||
confirm: async () => false,
|
||||
});
|
||||
it("surfaces include confinement hint for escaped include paths", () => {
|
||||
noteIncludeConfinementWarning({
|
||||
path: "/tmp/openclaw-config/openclaw.json",
|
||||
issues: [
|
||||
{
|
||||
message: "Include path escapes config directory: /etc/passwd",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(noteSpy).toHaveBeenCalledWith(
|
||||
|
||||
Reference in New Issue
Block a user