Codemod verified
Regularly tested and maintained by our engineers and codemod expert community.
Mocha
migration
byCodemod
Mocha/Vitest/Recipe
Last update
Jul 24, 2024
This recipe is a set of codemods that will upgrade your project from using mocha
to vitest
.
The recipe includes the following codemods:
NOTE: if you are not using vitest default .spec.*
or .test.*
file names, then you won't be able to run your tests upon migrating. To mitigate this and add your own set of globs, create vite.config.ts
file in the root of your project and add the following configuration, replacing **/test/*.ts
with your own globs:
import { configDefaults, defineConfig } from 'vitest/config';export default defineConfig({test: {include: [...configDefaults.include, '**/test/*.ts'],},});
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community