Repository navigation
Find the tests in the test file with acorn - #1046
Draft
exercism-agent[bot] wants to merge 1 commit into
Draft
exercism-agent[bot] wants to merge 1 commit into
exercism-agent[bot] wants to merge 1 commit into
Conversation
The reporter parsed the test file with @exercism/static-analysis, which uses @typescript-eslint/typescript-estree and so loads the whole TypeScript compiler on every run. Test files are plain JavaScript, so acorn reads them as well. On all 180 spec files in the track and the fixtures, the new code finds the same tests, names, task IDs, code and locations. Co-authored-by: iHiD <286476+iHiD@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello 🙂 I'm working with Claude to try and get our tooling faster.
This PR makes this project around 20% faster. I've run it in production to benchmark things in the real world against the most recent few hundred solutions, so I'm confident that it works robustly. However, I've not written the code. I have tried my hardest to get Claude to write sensible messages and comments that explains stuff, but I'd ask for your patience in the fact I'm sending AI code to you. Everything below here is from your friendly neighbourhood LLM...
This is the first of two draft PRs. Merge this one first, then #1047, which runs the tests with Node's built-in test runner. This one also works on its own.
What changed
After the tests run, the reporter parses the test file to show each test's code, find its task ID and work out which test printed each console message. It did this with
@exercism/static-analysis, which uses@typescript-eslint/typescript-estree. That package loads the whole TypeScript compiler on every run, which took about 0.4s.The reporter now parses the test file with acorn, a small JavaScript parser, in a new
src/tests.ts. On all 180 test files in the track and the runner's fixtures, it finds the same test names, task IDs, test code and locations as before.@exercism/static-analysis,@typescript-eslint/typescript-estreeand@typescript-eslint/visitor-keysare no longer dependencies. Students will see no change in results or messages.This has been tested in production, and has reduced the median run from 4.6s to 3.6s.
🤖 Generated with Claude Code