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.
🧰 Changes
Important
this continues to be a vitest supremacy account 😤
In this repo, we have tests that use
process.chdir()
, so we maintain a separate Vitest config for running those via aforks
pool vs. the standardthreads
pool — see #870 for more background on this.We've used two separate npm scripts (i.e.,
npm run test:multi && npm run test:single
) to run our tests sequentially. I discovered this morning that Vitest's workspaces feature isn't just for monorepos — it's actually the recommended way to maintain multiple test configurations no matter the context.In this PR, I consolidated our two test configs into a single workspace config. We get a few nice benefits by leveraging workspaces:
npx vitest --config vitest.single-threaded.config.ts [file]
). In other words,npx vitest [file]
✨ just works ✨, which should make it a lot easier for new contributors to run tests🧬 QA & Testing
Do all the tests run? And do they still run and pass properly? Here's the latest test run in
next
for comparison: https://github.com/readmeio/rdme/actions/runs/8910638856Footnotes
Small downside to this — workspaces don't allow you to configure coverage options. Not a huge deal since our coverage is great in this repo and we can stick to the defaults and it still addresses our needs. ↩