Files
reverse-engineering-anything/tests/boundary/cli/nodeSeaHashWork.test.ts
T

26 lines
978 B
TypeScript

import { readFile, writeFile } from "node:fs/promises";
import { join } from "node:path";
import { expect } from "vitest";
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
import { nodeSeaOverlappingMachO } from "../../fixtures/nodeSeaOverlapping.js";
import { cliTest } from "../../support/cli/cliFixture.js";
cliTest(
"reports excessive SEA duplicate verification through the public CLI",
async ({ cli }) => {
const root = await createTestTempDirectory("rea-sea-hash-work-cli-");
const path = join(root, "carrier");
const { bytes } = nodeSeaOverlappingMachO();
await writeFile(path, bytes);
const result = await cli.run({
arguments: ["inspect-artifact", path, "--json"],
});
expect(result.exitCode).toBe(1);
expect(result.json).toMatchObject({
code: "partial",
details: { reason: "limit", boundary: "capacity" },
});
expect((await readFile(path)).equals(bytes)).toBe(true);
},
);