All Projects β†’ skovhus β†’ Jest Codemods

skovhus / Jest Codemods

Licence: mit
Codemods for migrating to Jest https://github.com/facebook/jest πŸ‘Ύ

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Jest Codemods

Enzyme
JavaScript Testing utilities for React
Stars: ✭ 19,781 (+2606.02%)
Mutual labels:  jest, mocha, ava, chai
eslint-config-adjunct
A reasonable collection of plugins to use alongside your main esLint configuration
Stars: ✭ 39 (-94.66%)
Mutual labels:  mocha, jest, chai, ava
Istanbuljs
monorepo containing the various nuts and bolts that facilitate istanbul.js test instrumentation
Stars: ✭ 656 (-10.26%)
Mutual labels:  jest, mocha, ava
Javascript Testing Best Practices
πŸ“—πŸŒ 🚒 Comprehensive and exhaustive JavaScript & Node.js testing best practices (August 2021)
Stars: ✭ 13,976 (+1811.9%)
Mutual labels:  jest, mocha, chai
Redux Saga Testing
A no-brainer way of testing your Sagas
Stars: ✭ 150 (-79.48%)
Mutual labels:  jest, mocha, ava
Public
Repository for wallaby.js questions and issues
Stars: ✭ 662 (-9.44%)
Mutual labels:  jest, mocha, ava
Earl
β˜• Ergonomic, modern and type-safe assertion library for TypeScript
Stars: ✭ 153 (-79.07%)
Mutual labels:  jest, mocha, chai
awesome-javascript-testing
πŸ”§ Awesome JavaScript testing resources
Stars: ✭ 28 (-96.17%)
Mutual labels:  mocha, jest, ava
Rxjs Marbles
An RxJS marble testing library for any test framework
Stars: ✭ 267 (-63.47%)
Mutual labels:  jest, mocha, ava
Redux Actions Assertions
Simplify testing of redux action and async action creators
Stars: ✭ 177 (-75.79%)
Mutual labels:  jest, mocha, chai
qa-automation-base
There are basic projects for automation frameworks based on Kotlin/Java and TypeScript for the backend, frontend, and mobile.
Stars: ✭ 45 (-93.84%)
Mutual labels:  mocha, jest, chai
patent-free-react-ecosystem-migration-plan
Patent Free React Ecosystem Migration Plan
Stars: ✭ 15 (-97.95%)
Mutual labels:  mocha, jest, chai
react16-seed-with-apollo-graphql-scss-router4-ssr-tests-eslint-prettier-docker-webpack3-hot
Seed to create your own project using React with Apollo GraphQL client
Stars: ✭ 19 (-97.4%)
Mutual labels:  mocha, jest
Node Express Mongodb Jwt Rest Api Skeleton
This is a basic API REST skeleton written on JavaScript using async/await. Great for building a starter web API for your front-end (Android, iOS, Vue, react, angular, or anything that can consume an API). Demo of frontend in VueJS here: https://github.com/davellanedam/vue-skeleton-mvp
Stars: ✭ 603 (-17.51%)
Mutual labels:  mocha, chai
react-innertext
Returns the innerText of a React JSX object.
Stars: ✭ 37 (-94.94%)
Mutual labels:  mocha, chai
React Progressive Web App
An opinionated React based repository which is optimized for Progressive Web App development.
Stars: ✭ 548 (-25.03%)
Mutual labels:  mocha, chai
tropic
🍍 Test Runner Library
Stars: ✭ 29 (-96.03%)
Mutual labels:  mocha, jest
match-screenshot
A simple Jest or Chai matcher to compare screenshots, using Applitools Eyes
Stars: ✭ 14 (-98.08%)
Mutual labels:  jest, chai
spectron-typescript-starter
Spectron TypeScript Starter for e2e testing electron applications
Stars: ✭ 15 (-97.95%)
Mutual labels:  mocha, chai
express-mysql-rest
Building the simple api with sequelize, mysql and express js. this repository contains the code about how to use sequelize with mysql at express js. for example i have provide the crud operation to this repository. You can also testing the api with chai and mocha with chai-http by this repository
Stars: ✭ 25 (-96.58%)
Mutual labels:  mocha, chai

jest-codemods πŸ‘Ύ

Codemods that simplify migrating JavaScript and TypeScript test files from AVA, Chai, Expect.js (by Automattic), [email protected] (by mjackson), Jasmine, Mocha, proxyquire, Should.js and Tape to Jest.

Build Status version downloads Code Coverage MIT License PRs Welcome Tweet

Codemods are small programs that help you automate changes to your codebase. Think of them as search and replace on steroids.

We made jest-codemods so you can try out Jest on your existing codebase. We strive to make the migration as smooth as possible, but some manual intervention and tweaks to your tests are to be expected.

Usage (CLI)

To use the interactive CLI run

$ npx jest-codemods

If you do not have npx installed, you can install the jest-codemods command globally by running npm install -g jest-codemods.

For more options

$ npx jest-codemods --help

    Usage:      npx jest-codemods <path> [options]

    Examples:   npx jest-codemods src
                npx jest-codemods src/**/*.test.js

    Options:
      -f, --force       Bypass Git safety checks and force codemods to run
      -d, --dry         Dry run (no changes are made to files)

To transform all test files in a directory run jest-codemods . in your terminal.

Notice the console output for errors, manual intervention and tweaks might be required.

Usage (jscodeshift)

To make the process as simple as possible, we recommend the jest-codemods CLI that wraps the jscodeshift executable. But you can also run the transformations directly using jscodeshift.

$ npm install -g jscodeshift
$ npm install jest-codemods
$ jscodeshift -t node_modules/jest-codemods/dist/transformers/ava.js test-folder
$ jscodeshift -t node_modules/jest-codemods/dist/transformers/chai-assert.js test-folder
$ jscodeshift -t node_modules/jest-codemods/dist/transformers/chai-should.js test-folder
$ jscodeshift -t node_modules/jest-codemods/dist/transformers/expect-js.js test-folder
$ jscodeshift -t node_modules/jest-codemods/dist/transformers/expect.js test-folder
$ jscodeshift -t node_modules/jest-codemods/dist/transformers/jasmine-globals.js test-folder
$ jscodeshift -t node_modules/jest-codemods/dist/transformers/jasmine-this.js test-folder
$ jscodeshift -t node_modules/jest-codemods/dist/transformers/mocha.js test-folder
$ jscodeshift -t node_modules/jest-codemods/dist/transformers/should.js test-folder
$ jscodeshift -t node_modules/jest-codemods/dist/transformers/tape.js test-folder

Test environment: Jest on Node.js or other

If you're using Jest as your test runner and executing tests on Node.js, you'll want to use the default option when prompted. In this case, jest-codemods assumes that global values such as expect and jest are provided and will not require() them explicitly.

If, however, you are using a different test runner or executing Jest tests in a browser, you may need to choose the option with explicit require() calls.

In the second case, after running jest-codemods, you might need to install a few dependencies:

yarn add --dev expect jest-mock

npm install --save-dev expect jest-mock

Transformations

If possible import / require statements determine if any transformation are carried out. The original code quoting style is preserved. Warnings are made if packages are used that are incompatible with Jest.

Inspiration

Thanks to avajs/ava-codemods for inspiration and original CLI setup.

The Mocha and Chai assert support began its life at paularmstrong/mocha-to-jest-codemod.

Chai Should/Expect came from AlexJuarez/chai-to-jasmine.

Links

Contributing

To get started, run:

yarn

When developing:

yarn verify  # (build/lint/test)
yarn build
yarn lint
yarn test
yarn test:cov
yarn test:watch

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].