Skip to content

Commit c2a065e

Browse files
test(core): parse optimization status regardless of forced color
With FORCE_COLOR set, as in an interactive terminal, console.log colors the numbers it prints, so the `done <before> <after>` regex never matched and both optimization tests failed. Print a single interpolated string, which is never colored. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7f4107e commit c2a065e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/core/tests/optimization.integ.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe("optimization helpers", () => {
2121
`const target = () => 1;
2222
const before = %GetOptimizationStatus(target);
2323
require(${corePath}).optimizeFunctionSync(target);
24-
console.log("done", before, %GetOptimizationStatus(target));`,
24+
console.log(\`done \${before} \${%GetOptimizationStatus(target)}\`);`,
2525
);
2626
const [, before, after] = stdout.match(/done (\d+) (\d+)/) ?? [];
2727
expect(stdout).toContain("done");
@@ -34,7 +34,7 @@ describe("optimization helpers", () => {
3434
const before = %GetOptimizationStatus(target);
3535
require(${corePath})
3636
.optimizeFunction(target)
37-
.then(() => console.log("done", before, %GetOptimizationStatus(target)));`,
37+
.then(() => console.log(\`done \${before} \${%GetOptimizationStatus(target)}\`));`,
3838
);
3939
const [, before, after] = stdout.match(/done (\d+) (\d+)/) ?? [];
4040
expect(stdout).toContain("done");

0 commit comments

Comments
 (0)