fix(filesystem): reject unstable artifact targets

This commit is contained in:
morluto
2026-10-10 04:14:54 +08:00
parent 66a20a2597
commit 7829b1aeef
11 changed files with 359 additions and 58 deletions
@@ -24,6 +24,29 @@ import {
} from "../../../src/domain/binaryTarget.fixture.js";
import { projectAnalysisError } from "../../../src/domain/analysisErrorProjection.js";
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
import { readWithoutFifoWriter } from "../../fixtures/fifoInput.js";
it.skipIf(process.platform === "win32")(
"rejects a selected FIFO without waiting for a writer",
async () => {
const root = await createTestTempDirectory("rea-binary-target-fifo-");
const fifoPath = join(root, "input.bin");
await promisify(execFile)("mkfifo", [fifoPath]);
const outcome = await readWithoutFifoWriter(fifoPath, () =>
parseBinaryTarget(fifoPath),
);
expect(outcome.state).toBe("completed");
if (outcome.state !== "completed")
throw new Error("Binary target resolution waited for a FIFO writer");
expect(outcome.result).toMatchObject({
ok: false,
error: {
_tag: "BinaryTargetError",
reason: "target is not a regular file",
},
});
},
);
describe("binary target I/O: app plist permissions and decoding", () => {
it.each([