test(frontend): load the lazy pages once before the route tests (#103) #104
+15
−3
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.
Closes #103
What
Loads the lazy pages once in a
beforeAllwith a 30 s timeout, before the route tests run.Why
The first test that opened a lazy page waited for Vitest to build the page's code. When the whole suite runs at once, that could take longer than Vitest's default test timeout of 5000 ms, so the test timed out now and then (seen in the review of #102).
How to test
Run
npm run test:coverageinfrontenda few times. Passed 3 of 3 runs locally.AI
Claude helped find the cause (the
findBytimeout was the same as the test timeout) and suggested the fix. I wrote the change myself and ran the tests comparing the old and the new.