Skip to content

A code mod for migrating React Testing Library or Enzyme tests to Cypress component tests

License

Notifications You must be signed in to change notification settings

danadajian/cypress-codemod

Repository files navigation

cypress-codemod

A codemod for migrating React Testing Library or Enzyme tests to Cypress component tests!

Usage

Run against a single test file:

npx cypress-codemod --filePath path/to/my-test.tsx

Run recursively against all files in directory:

npx cypress-codemod --directory path/to/directory-containing-tests/

CLI Options

Option Type Description
--filePath, -f String A path to a test file to migrate. If ommitted, --directory is required.
--directory, -d String A directory containing test files to migrate. If ommitted, --filePath is required.
--customMountCommand String A custom command to use instead of cy.mount()
--customDOMEmptyCommand String A custom command to use for asserting the DOM is empty.