/wire-service-jest-util-migrate

Tool to migrate jest tests using @salesforce/wire-service-jest-util v2.x to v3.x

Primary LanguageJavaScriptMIT LicenseMIT

Overview

Tool to migrate jest tests using @salesforce/wire-service-jest-util v2.x to v3.x. Built on top of jscodeshift project.

@salesforce/wire-service-jest-util v3.x changes the way of writing jest test for components using @wire, see the migration guide. This package goal is to help you migrate existing tests into the new format established by @salesforce/wire-service-jest-util library.

Usage

Clone this repository

git clone --depth 1 git@github.com:jodarove/wire-service-jest-util-migrate.git
cd wire-service-jest-util-migrate

Install npm dependencies

npm install

Change existing tests

Once the project is installed, you can migrate your existing tests by running:

npm run transform <path>

Replace <path> with a glob pattern pointing to your sfdx project, for example: ~/projects/github/lwc-recipes/**/*.test.js

Note: You can pass any of the options defined in jscodeshift.