Files
reverse-engineering-anything/tests/evaluation/testDiscovery.test.ts
T
morluto 7bcefead69 test: strengthen and prune audited test coverage (#8573)
* test: strengthen and prune audited test coverage

* test: require delivered DeepSeek skill instructions

* test: keep schema fixture types private

* test: verify Gemini receives skill instructions

* test: bind Qwen skill evidence to its tool result

* test: report NativeAOT verifier checks precisely

* fix: verify Ghidra cleanup paths reliably

* fix: verify Command Code skill activation

* test: tighten cleanup and fixture checks

* test: verify packet capture evidence is recorded

* fix: report HTTP3 capture provenance accurately

* test: preserve resource coverage through MCP

* test: prune repeated assertions and retain cancellation identity

* fix: validate client verifier fixture paths

* test: skip Copilot verifier cases on Windows

* test: keep verifier setup target relative
2026-11-02 02:13:32 +08:00

73 lines
2.0 KiB
TypeScript

import { resolve } from "node:path";
import { describe, expect, it } from "vitest";
import { compareTestDiscovery } from "../../scripts/lib/test-discovery.mjs";
const root = resolve("test-discovery-fixture");
const first = "src/domain/sample.test.ts";
const second = "src/new-provider/sample.test.ts";
describe("test discovery migration guard", () => {
it("accepts absolute discovered paths without changing their project ownership", () => {
expect(
compareTestDiscovery(
[first],
[{ file: resolve(root, first), projectName: "domain" }],
root,
),
).toEqual({
missing: [],
unexpected: [],
duplicates: [],
wrongProjects: [],
discovered: 1,
});
});
it("reports a discovered test in the wrong project", () => {
expect(
compareTestDiscovery(
[first],
[{ file: first, projectName: "cli-boundary" }],
root,
).wrongProjects,
).toEqual([{ file: first, expected: "domain", actual: "cli-boundary" }]);
});
it("reports a new provider test omitted by the current project globs", () => {
expect(
compareTestDiscovery(
[first, second],
[{ file: first, projectName: "domain" }],
root,
).missing,
).toEqual([second]);
});
it("reports overlapping project discovery and unexpected files separately", () => {
const report = compareTestDiscovery(
[first],
[
{ file: first, projectName: "domain" },
{ file: first, projectName: "adapters" },
{ file: second, projectName: "adapters" },
],
root,
);
expect(report.duplicates).toEqual([
{ file: first, projects: ["adapters", "domain"] },
]);
expect(report.unexpected).toEqual([second]);
});
it.each([
null,
{},
[{ file: "", projectName: "domain" }],
[{ file: first }],
[{ file: first, projectName: null }],
])("rejects malformed producer output: %j", (input) => {
expect(() => compareTestDiscovery([first], input, root)).toThrow(TypeError);
});
});