Commit 68799fc
Token Goat Test
test(cli_context_stats): isolate os.homedir() so claude_md_total pin is machine-independent
Codex peer review caught this: the prior 2530 pin was computed with the real
developer machine's ~/.claude/CLAUDE.md folded into the total (findClaudeMdFiles
reads it unconditionally, and isolate-home.ts only redirects HOME on macOS).
That value would differ on any other machine and doesn't exist at all on a
fresh CI runner, so the pin was silently machine-specific and would have
failed on the very next CI run. Mock os.homedir() to the test's own isolated
tempDir, matching the pattern already used by the other tests in this file,
so claude_md_total is a pure function of the 400-byte fixture (100 tokens).1 parent 53489f2 commit 68799fc
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
180 | 188 | | |
181 | 189 | | |
182 | 190 | | |
| |||
188 | 196 | | |
189 | 197 | | |
190 | 198 | | |
| 199 | + | |
191 | 200 | | |
192 | | - | |
| 201 | + | |
193 | 202 | | |
194 | 203 | | |
195 | 204 | | |
| |||
0 commit comments