test: extract shared fixtures, drop knip carve-outs (#627)

* refactor(domain): consolidate canonical ordering and digest helpers (#624)

* refactor(domain): consolidate canonical ordering and digest helpers

Single owner for code-point ordering (domain/canonicalOrdering.ts)
and canonical JSON digests (domain/comparisonSemantics.ts). Delete
all local compareCodePoints/compareText/digestCanonical duplicates
and migrate every importer. No re-export shims.

* fix(ci): allow slower real browser startup

* chore(config): remove dead eslint, dedupe scripts, cacheable turbo tasks

Delete eslint.config.js (oxlint is the linter), drop lint:dead alias,
pin smol-toml, fold jscpd/scan:todos into check:pr, make test:run
cacheable, align oxlint ignores.

* fix(config): hash all test inputs for cached runs

* docs: fix architecture diagram and pretty-print tool catalog

Drop dangling REPLAY edges, add dotnet/reference/error/evaluation
nodes. Emit 2-space JSON from the catalog generator and regenerate.

* test: extract shared fixtures, drop knip carve-outs

Dedupe android/apple session tests, bundler adapter headers, and
reconstruction helpers into tests/support fixtures. Delete unused
type aliases and the knip ignoreIssues block. Lower jscpd threshold
2.7 to 2.5.
This commit is contained in:
morluto authored and GitHub committed 2026-10-06 05:00:16 +08:00
1 parent 5e7f35c7c3
commit 55e5eb090b
14 files changed
+375 -354

No files matched your search

@@ -184,26 +184,18 @@ it("keeps suffix-named ASAR directories in the graph and analyzes their files",
),
).toBe(true);
const result = await reconstructJavaScriptArtifact({
input_path: archive,
format: "asar",
});
expect(result.statistics.parsed_javascript_files).toBeGreaterThan(0);
expect(result.graph.nodes).toEqual(
expect.arrayContaining([
expect.objectContaining({
kind: "javascript-asset",
observations: expect.arrayContaining([
expect.objectContaining({
properties: expect.objectContaining({
path: "node_modules/@zip.js/entry.js",
}),
await reconstructAsarArchive(archive, [
expect.objectContaining({
kind: "javascript-asset",
observations: expect.arrayContaining([
expect.objectContaining({
properties: expect.objectContaining({
path: "node_modules/@zip.js/entry.js",
}),
]),
}),
]),
);
}),
]),
}),
]);
});
it("keeps ASAR analysis usable when unpacked native companion bytes are absent", async () => {
@@ -228,17 +220,9 @@ it("keeps ASAR analysis usable when unpacked native companion bytes are absent",
]),
});
const result = await reconstructJavaScriptArtifact({
input_path: archive,
format: "asar",
});
expect(result.statistics.parsed_javascript_files).toBeGreaterThan(0);
expect(result.graph.nodes).toEqual(
expect.arrayContaining([
expect.objectContaining({ kind: "javascript-asset" }),
]),
);
await reconstructAsarArchive(archive, [
expect.objectContaining({ kind: "javascript-asset" }),
]);
});
it("recurses into filesystem-backed ASAR containers without losing container-relative paths", async () => {
@@ -360,6 +344,21 @@ const assertSemanticLinks = (
expect(endpointJson).toContain("token=fixture-secret");
};
const reconstructAsarArchive = async (
archive: string,
expectedNodes: readonly unknown[],
): Promise<Awaited<ReturnType<typeof reconstructJavaScriptArtifact>>> => {
const result = await reconstructJavaScriptArtifact({
input_path: archive,
format: "asar",
});
expect(result.statistics.parsed_javascript_files).toBeGreaterThan(0);
expect(result.graph.nodes).toEqual(
expect.arrayContaining([...expectedNodes]),
);
return result;
};
const fixtureDirectory = async (): Promise<string> => {
const root = await createTestTempDirectory("rea-javascript-artifact-");
await writeJavaScriptArtifactFixture(root);