test: remove stale limits and handoff expectations
This commit is contained in:
@@ -6,22 +6,7 @@ import { describe, expect, it } from "vitest";
|
||||
import { parseCliJsonInput } from "../../../src/cliJsonInput.js";
|
||||
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
||||
|
||||
const MAX_BYTES = 64 * 1_024 * 1_024;
|
||||
|
||||
describe("bounded CLI JSON input", () => {
|
||||
it("rejects oversized inline UTF-8 before returning or echoing its content", async () => {
|
||||
const input = `"${"é".repeat(MAX_BYTES / 2)}"`;
|
||||
expect(input.length).toBeLessThan(MAX_BYTES);
|
||||
const result = await parseCliJsonInput(input, "test-input");
|
||||
expect(result.ok).toBe(false);
|
||||
if (result.ok) return;
|
||||
expect(result.error).toMatchObject({
|
||||
input_reason: "too-large",
|
||||
maximum_input_bytes: MAX_BYTES,
|
||||
});
|
||||
expect(JSON.stringify(result.error).length).toBeLessThan(1_024);
|
||||
});
|
||||
|
||||
describe("CLI JSON input", () => {
|
||||
it("preserves JSON scalars and distinguishes malformed inline text from files", async () => {
|
||||
for (const value of [null, false, 0, "text", [], {}])
|
||||
expect(
|
||||
@@ -39,7 +24,7 @@ describe("bounded CLI JSON input", () => {
|
||||
});
|
||||
expect(await parseCliJsonInput(root, "test-input")).toMatchObject({
|
||||
ok: false,
|
||||
error: { input_reason: "not-file" },
|
||||
error: { input_reason: "read-failed" },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user