🚀 Feature: Migration should call out needing to migrate non-Vitest tests to Vitest #1375
Open
2 tasks done
Labels
status: accepting prs
Please, send a pull request to resolve this!
type: feature
New enhancement or request
Bug Report Checklist
main
branch of the repository.Overview
Splitting out of #1355: migration markets itself to be a one-stop-shop solution for aligning an existing repo to this template. But when run on an existing repository with tests written in a non-Vitest testing library (e.g. Jest), the actual test files aren't migrated over to Vitest. This leads to broken expectations with users.
The migration script should let the user know they need to migrate their tests manually.
Proposal: if Mocha or Jest was previously in the repository, add another 🟡 note similar to the existing ones?
Note that there's no automatic migrator command/project that can be referenced. Building one would be quite complex, and likely impossible to get fully right. Vitest's Migrating from Jest docs is probably the best place we can send Vitest users.
Maybe good phrasing would look something like the following?
🟡 You'll need to manually migrate your Jest tests to Vitest. See https://vitest.dev/guide/migration.html#migrating-from-jest for more information.
🟡 You'll need to manually migrate your Mocha tests to Vitest.
...where if detection for other test frameworks is added, it'd use the same template as Mocha?
Additional Info
It's tempting to suggest running
pnpm test
to know whether to generate the 🟡... but unit tests might take a very long time and/or have unintended side effects. That's not something we should do for the user.Co-authored-by: @danvk
The text was updated successfully, but these errors were encountered: