Files
rea/tests/boundary/process/processHostIdentity.test.ts
morluto 584120e802 refactor(process): remove the redundant scenario parsing alias
Use the authoritative scenario schema directly in all 25 test consumers. Preserve unknown-input annotations and every lifecycle, permission, normalization, identity and cleanup assertion; retain the separate branded capture validation boundary.
2026-10-24 09:57:15 +08:00

44 lines
1.3 KiB
TypeScript

import { ProcessOwnershipEvidenceOwner } from "../../../src/process/ProcessOwnershipEvidence.js";
import { expect, it } from "vitest";
import { processScenarioSchema } from "../../../src/domain/process/processScenario.js";
import {
createRunManifest,
observeLaunchedExecutable,
observeSelectedExecutable,
observeSettlement,
} from "../../../src/process/capture/ProcessCaptureLifecycle.js";
it("uses one selected host identity for manifest and settlement", async () => {
const scenario = processScenarioSchema.parse({
executable: process.execPath,
working_directory: process.cwd(),
events: [],
});
const selectedHost = {
platform: "win32" as const,
architecture: "arm64" as const,
};
const selectedExecutable = await observeSelectedExecutable(
scenario.executable,
);
const manifest = await createRunManifest(
scenario,
new Date(0),
new Date(1),
observeLaunchedExecutable(scenario.executable, selectedExecutable),
selectedHost,
);
const settlement = await observeSettlement({
runId: "run",
processGroupIds: [],
settleMs: 0,
recordEvent: () => undefined,
platform: selectedHost.platform,
ownershipEvidence: new ProcessOwnershipEvidenceOwner(),
});
expect(manifest).toMatchObject(selectedHost);
expect(settlement).toEqual({ state: "unverifiable", elapsed_ms: 0 });
});