Files
reverse-engineering-anything/src/application/AppBundleExecutable.openStep.test.ts
T
morluto 352a846127 test: reduce brittle assertions and test-only runtime paths (#9289)
* test: focus assertions on behavioral evidence

Prune redundant and wording-coupled checks while retaining diagnostic, parser, recovery, and cleanup coverage.

* refactor: remove test-only wrappers and duplicate checks

Exercise production operations through test fixtures, remove unused adapters, and keep managed-member uncertainty guidance under its existing owner.

* test: focus process validation on diagnostic facts

* refactor: remove test-only runtime helpers

Move semantic evidence fixture setup out of runtime and remove unused Windows settle recovery helpers while checking configured defaults independently.

* test: focus artifact diagnostics on format facts

* test: verify retained cleanup guidance delivery
2026-11-08 02:02:31 +08:00

30 lines
1.1 KiB
TypeScript

import { mkdir, writeFile } from "node:fs/promises";
import { join } from "node:path";
import { expect, it } from "vitest";
import { createTestTempDirectory } from "../../tests/fixtures/temporaryDirectory.js";
import { resolveAppBundleExecutable } from "./AppBundleExecutable.js";
it.each([
["no comment", ""],
["block comment", "/* App metadata */\n"],
["line comment", "// App metadata\n"],
["mixed comments", " \t/* header */\n// executable selection\n"],
])("resolves an OpenStep Info.plist with %s", async (_label, prefix) => {
const root = await createTestTempDirectory("rea-openstep-bundle-");
const bundle = join(root, "Fixture.app");
const programs = join(bundle, "Contents", "MacOS");
const executable = join(programs, "Fixture");
const infoPlist = join(bundle, "Contents", "Info.plist");
const source = `${prefix}{ CFBundleExecutable = Fixture; }`;
await mkdir(programs, { recursive: true });
await writeFile(infoPlist, source);
await writeFile(executable, "fixture - never executed");
expect(await resolveAppBundleExecutable(bundle)).toEqual({
ok: true,
value: { executable, infoPlist },
});
});