mirror of
https://github.com/morluto/rea.git
synced 2026-11-14 18:52:48 +00:00
test(javascript): share primitive expansion producer fixtures
This commit is contained in:
1 parent
449d57075e
commit
c867bcd0aa
4 files changed
+35
-40
No files matched your search
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
primitiveCandidateExpansionSource,
|
||||
primitiveByteExpansionSource,
|
||||
} from "../../fixtures/javascriptPrimitiveExpansion.js";
|
||||
import { createHash } from "node:crypto";
|
||||
import { mkdir, rm, writeFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
@@ -102,23 +106,8 @@ it("preserves graph commitments and export shapes when consuming file-local IR",
|
||||
|
||||
it("reports semantic value resource limits in application graph coverage", async () => {
|
||||
const root = await createTestTempDirectory("rea-javascript-semantic-limit-");
|
||||
const expression = Array.from(
|
||||
{ length: 20 },
|
||||
() => '(true ? "a" : "b")',
|
||||
).join(" + ");
|
||||
await writeFile(
|
||||
join(root, "app.js"),
|
||||
`const answer = { nested: ${expression} };`,
|
||||
);
|
||||
const declarations = ['const value0 = "x";'];
|
||||
for (let index = 1; index <= 30; index += 1) {
|
||||
const previous = `value${String(index - 1)}`;
|
||||
declarations.push(
|
||||
`const value${String(index)} = ${previous} + ${previous};`,
|
||||
);
|
||||
}
|
||||
declarations.push("const answer = value30;");
|
||||
await writeFile(join(root, "growth.js"), declarations.join("\n"));
|
||||
await writeFile(join(root, "app.js"), primitiveCandidateExpansionSource());
|
||||
await writeFile(join(root, "growth.js"), primitiveByteExpansionSource());
|
||||
const snapshot = await scanCanonicalArtifactInventory(root, {});
|
||||
const reader = createJavaScriptArtifactReader(root, "directory");
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user