Enable run-detect-module-type test and fix its import.cjs fixtures - #37182
Open
robobun wants to merge 6 commits into
Open
Enable run-detect-module-type test and fix its import.cjs fixtures#37182robobun wants to merge 6 commits into
robobun wants to merge 6 commits into
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
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.
Loading