Mocha
migration
byCodemod

Mocha/Vitest/Migrate Test

/icons/calendar.svg

Last update

Jul 24, 2024

Run this codemod to upgrade your codebase from using mocha to vitest.

Example

Before

import { expect } from 'chai';
describe('Test Suite 1', () => {
it('addition', () => {
expect(1 + 1).to.equal(2);
});
});

After

import { describe, expect, it } from 'vitest';
describe('Test Suite 1', () => {
it('addition', () => {
expect(1 + 1).to.equal(2);
});
});

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now