Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Angular
  3. jest-codemods

jest-codemods

MITTypeScript0.35.0

Codemods for migrating JavaScript and TypeScript test files from various frameworks to Jest.

GitHubGitHub
887 stars81 forks0 contributors

What is jest-codemods?

jest-codemods is a tool that provides automated code transformations to migrate JavaScript and TypeScript test suites from multiple testing frameworks to Jest. It simplifies the adoption of Jest by handling syntax and API differences, reducing manual effort and enabling teams to try Jest on existing codebases. The tool uses codemods, which are small programs for automated code changes, to make migration as smooth as possible.

Target Audience

Developers and teams with existing test suites in frameworks like AVA, Chai, Jasmine, Mocha, Tape, or Sinon who want to migrate to Jest. It is particularly useful for those managing large codebases where manual migration would be time-consuming.

Value Proposition

Developers choose jest-codemods because it supports a wide range of testing frameworks (including AVA, Chai, Jasmine, Mocha, Tape, and Sinon) and offers both an interactive CLI for ease of use and jscodeshift integration for advanced customization. Its ability to preserve code style and detect imports automatically reduces errors and manual tweaks during migration.

Overview

Codemods for migrating to Jest https://github.com/facebook/jest 👾

Use Cases

Best For

  • Migrating large test suites from Mocha or Jasmine to Jest with minimal manual intervention.
  • Automating the conversion of Chai assertion libraries (including assert, should, and expect) to Jest's expect API.
  • Transitioning from lightweight testing frameworks like AVA or Tape to Jest while maintaining code quoting style.
  • Handling migrations involving Sinon.js mocking and stubbing utilities to Jest's built-in mocking capabilities.
  • Converting TypeScript test files from other frameworks to Jest without losing type safety or import structures.
  • Integrating with existing CI/CD pipelines using jscodeshift for batch transformations across multiple directories.

Not Ideal For

  • Projects migrating from Vitest or other Jest-like frameworks not listed in supported transformations
  • Test suites with extensive custom test runners or assertion libraries beyond the 11 supported frameworks
  • Teams expecting a fully automated, zero-touch migration with no manual code tweaks required

Pros & Cons

Pros

Wide Framework Coverage

Supports migration from 11+ testing frameworks including AVA, Mocha, and Sinon, as listed in the README, making it versatile for diverse codebases.

Interactive CLI with Safety

Includes dry-run and force options in the CLI, allowing users to preview changes before applying them, reducing the risk of errors.

TypeScript Compatibility

Handles both JavaScript and TypeScript test files, preserving import structures and type safety during transformation, as noted in the features.

Style-Aware Transformations

Maintains original code quoting style and uses import/require statements to automatically determine applicable transformations, ensuring consistency.

Cons

Manual Intervention Required

The README explicitly warns that manual tweaks are expected post-migration, and compatibility alerts indicate not all packages are seamlessly converted.

Complex Setup for Advanced Use

Using jscodeshift directly requires installing multiple packages and running separate commands for each transformer, which can be cumbersome for large migrations.

Limited to Listed Frameworks

Only supports specific frameworks listed; custom or niche testing setups, such as those using Karma or unsupported assertion libraries, are not covered.

Frequently Asked Questions

Quick Stats

Stars887
Forks81
Contributors0
Open Issues26
Last commit1 day ago
CreatedSince 2016

Tags

#javascript-testing#codemod#cli-tool#automated-refactoring#codemods#testing#ava#mocha#testing-tools#tape#jest

Built With

N
Node.js

Included in

Angular10.0k
Auto-fetched 9 hours ago

Related Projects

ts-jestts-jest

A Jest transformer with source map support that lets you use Jest to test projects written in TypeScript.

Stars7,076
Forks476
Last commit2 days ago
jest-previewjest-preview

Debug your Jest tests. Effortlessly.🛠🖼

Stars2,396
Forks81
Last commit7 days ago
jest-preset-angularjest-preset-angular

Jest configuration preset for Angular projects.

Stars916
Forks304
Last commit12 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub