test: add limit monotonicity and partial-evidence regressions
This commit is contained in:
@@ -365,10 +365,14 @@ describe("JavaScript artifact reconstruction", () => {
|
||||
const root = await mkdtemp(join(tmpdir(), "rea-javascript-ast-limit-"));
|
||||
await writeFile(
|
||||
join(root, "large.js"),
|
||||
Array.from(
|
||||
{ length: 100 },
|
||||
(_, index) => `export const value${String(index)} = ${String(index)};`,
|
||||
).join("\n"),
|
||||
[
|
||||
'import "./unobserved.js";',
|
||||
...Array.from(
|
||||
{ length: 100 },
|
||||
(_, index) =>
|
||||
`export const value${String(index)} = ${String(index)};`,
|
||||
),
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
const result = await reconstructJavaScriptArtifact({
|
||||
@@ -383,6 +387,18 @@ describe("JavaScript artifact reconstruction", () => {
|
||||
truncated: true,
|
||||
omitted_count: null,
|
||||
});
|
||||
const derivedImport = result.graph.edges.find(
|
||||
({ relation, properties }) =>
|
||||
relation === "imports" && properties.specifier === "./unobserved.js",
|
||||
);
|
||||
expect(derivedImport?.evidence.coverage).toEqual({
|
||||
status: "partial",
|
||||
truncated: true,
|
||||
omitted_count: null,
|
||||
limits: expect.arrayContaining([
|
||||
{ name: "max-ast-nodes", value: 50, unit: "items" },
|
||||
]),
|
||||
});
|
||||
});
|
||||
|
||||
it("does not follow symlinks or read oversized JavaScript text", async () => {
|
||||
|
||||
Reference in New Issue
Block a user