import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; import { afterEach, describe, expect, it, vi } from "vitest";
type CapturedEditOperations = {
access: (absolutePath: string) => Promise<void>;
};
// access must NOT throw for outside-workspace paths; the upstream // library replaces any access error with a misleading "File not found". // By resolving silently the subsequent readFile call surfaces the real // "Path escapes workspace root" / "outside-workspace" error instead.
await expect(
mocks.operations!.access(path.join(workspaceDir, "escape", "secret.txt")),
).resolves.toBeUndefined();
},
);
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.