Mocha/Vitest/Migrate Test

1.0.2Last update Jan 10, 2025
by@Codemod
Mocha
migration

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