Skip to content

chore: tell agents how to focus tests#7908

Open
lerouxb wants to merge 2 commits intomainfrom
update-agents-tests
Open

chore: tell agents how to focus tests#7908
lerouxb wants to merge 2 commits intomainfrom
update-agents-tests

Conversation

@lerouxb
Copy link
Copy Markdown
Member

@lerouxb lerouxb commented Mar 25, 2026

I noticed that claude kept figuring out how to focus a test again and again, grepping things all over and spending lots of time on it.

So I asked it to just update the AGENTS.md file to tell itself how to do that in future. Let's see if it helps?

Coincidentally it started with npm test -- --grep "test description pattern" (note the space after grep) which doesn't work. I pointed out that it doesn't work and asked it to figure out how to fix it and it realised you need the =. This is actually a thing I have run into again and again myself, so if anything this is useful documentation for humans.

@lerouxb lerouxb requested a review from a team as a code owner March 25, 2026 10:22
@lerouxb lerouxb requested review from Anemy and Copilot March 25, 2026 10:22
@lerouxb lerouxb added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Mar 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates repository agent guidance to reduce time spent rediscovering how to run and focus tests in this monorepo.

Changes:

  • Add “Running tests” section to AGENTS.md with examples for running a single spec file in a workspace/package.
  • Add guidance for filtering tests by description using a --grep argument.

npm test -- --grep="test description pattern"
```

Note: Use `--grep="pattern"` with equals sign, not `--grep "pattern"` with a space.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW this is a bug in our shared mocha config

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah. But I think we can fix that separately - the change to the AGENTS.md file would be one character but this would still work even after we fix it anyway.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we have a ticket to fix that we can add a note to clean this up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants