From 50ef6a19333f2560515c30023fbc78e20da33ac9 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 8 Sep 2026 14:05:23 +0000 Subject: [PATCH] test(eval): accept a .js slice component The slice component eval looked for a .tsx or .jsx file. The eval project has no tsconfig.json, so it is a JavaScript project. Next.js compiles JSX in .js files, and Slice Machine writes index.js for JavaScript projects. The eval failed a trial that wrote a valid component. The eval now also accepts .js. The failure message lists the files in the slice folder, so the next failure shows what the agent wrote. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_0194f9d6dLEYage35y3snFaD --- evals/render-content.eval.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evals/render-content.eval.ts b/evals/render-content.eval.ts index 2f69ef07..d27aa1ef 100644 --- a/evals/render-content.eval.ts +++ b/evals/render-content.eval.ts @@ -17,8 +17,8 @@ it.for(trials)("writes a slice component", async (_, { project, agent, expect }) const dir = new URL("slices/Testimonial/", project); const files = await readdir(dir); - const componentFile = files.find((file) => /\.(t|j)sx$/.test(file)); - expect(componentFile).toBeTruthy(); + const componentFile = files.find((file) => /\.(tsx|jsx?)$/.test(file)); + expect(componentFile, `slices/Testimonial/ has ${files.join(", ")}`).toBeTruthy(); const component = await readFile(new URL(componentFile!, dir), "utf8"); expect(component).toContain("quote"); expect(component).toContain("avatar");