Repository navigation
Report missing tests from the main Jest run (~12% faster) - #1039
Conversation
|
The babel etc. stuff used to be necessary to run the tests on exercises that required babel. Is that no longer needed and does pnpm just pick it up? Also, version 3 wasn't allowed to list an empty array of tests with a message, that's why it was using version 1 for such an output. Is this no longer the case? |
|
The Babel setup is unchanged. run.sh still swaps in the runner's You're right about the version. The reporter was writing version 3 with |
|
Can you keep a variant for debugging, or add a flag so the speed-up is there in prod but we can still get this output? It will be important when at some point it breaks. |
…istTests run Co-authored-by: iHiD <286476+iHiD@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Version 3 results can't have an empty list of tests, so when Jest finds no test files the reporter now writes exactly what run.sh wrote before: version 1, status "error" and the same message, with no tests key. Co-authored-by: iHiD <286476+iHiD@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
56f6ccb to
f899b54
Compare
|
Actually I don't care, because then I need to explain why we had this in the first place. |
Hello 🙂 I'm working with Claude to try and get our tooling faster.
This PR makes this project around 12% 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 PR follows #1038, which is now merged.
What changed
Before the real test run,
run.shstarted Jest a first time with--listTests, only to check that the solution has at least one test file. Each Jest start costs about 0.3 seconds.Now Jest starts once. If it finds no test files, the reporter writes the same error as before: status
error, with the message "The submitted code was not subjected to any type or execution tests. At least one test was expected."The check now also uses the same Jest config as the real run. The
--listTestsrun picked up the exercise'sjest.config.js, which has different test patterns fromjest.runner.config.js.This removes about 60 lines from
run.sh.This has been tested in production, and has reduced the median run from 2.7s to 2.4s.
🤖 Generated with Claude Code