Skip to content

fix(band): count a test run only when the runner is the command - #1397

Open
daviorlando wants to merge 1 commit into
DietrichGebert:mainfrom
daviorlando:fix/band-test-command
Open

daviorlando wants to merge 1 commit into
DietrichGebert:mainfrom
daviorlando:fix/band-test-command

Conversation

@daviorlando

Copy link
Copy Markdown

The runner now has to be in command position:

  • at the start of the command;
  • after ;, &, |, ( or a path;
  • behind run, exec, npx, bunx, pnpx, time, env, nice, timeout N, or VAR=value.

It must also not be followed by ., - or a word character. So uv run pytest, CI=1 npx vitest run, ./node_modules/.bin/jest, cd api && python -m pytest and bundle exec rspec still count, and the commands in the issue no longer do.

Added these cases to tests/band.test.tsx. I can't run that file outside Claude Code (it imports claude-code/testing), so I loaded the real metrics.ts in Node 24 and checked the same cases plus about 30 more, before and after the change. npm test, check-rule-copies and check-versions pass. The only failure is the pandas CSV case, which fails because pandas isn't installed locally, same as on main.

Fixes #1396

🤖 Generated with Claude Code

TEST_CMD matched anywhere in the line, so `cat jest.config.js`, `pip install pytest`
or `grep -r vitest src` set the band's tests to pass with no counts, overwriting a
real failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Band counts cat jest.config.js or pip install pytest as a test run

1 participant