Skip to content

Enable run-detect-module-type test and fix its import.cjs fixtures - #37182

Open
robobun wants to merge 6 commits into
mainfrom
farm/ff6be295/fix-detect-module-type-test
Open

Enable run-detect-module-type test and fix its import.cjs fixtures#37182
robobun wants to merge 6 commits into
mainfrom
farm/ff6be295/fix-detect-module-type-test

test: enable run-detect-module-type and fix its import.cjs fixtures

9545f15
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Aug 8, 2026 in 6m 40s

Code review found 1 potential issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit test/cli/run/run-detect-module-type.test.ts:51 Module-type assertion accepts any non-"false" stdout as "module"

Annotations

Check warning on line 51 in test/cli/run/run-detect-module-type.test.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

Module-type assertion accepts any non-"false" stdout as "module"

nit: `stdout.trim() === "false" ? "commonjs" : "module"` maps any non-"false" output — including empty string or garbage — to "module", so the 12 module-expected cases would still pass if a fixture exited 0 with unexpected stdout. Since each fixture can only print "true" or "false", assert that directly: map `"true"`→`"module"`, `"false"`→`"commonjs"`, and anything else to the raw stdout so the final `toEqual` fails visibly.