2.2.0-fork • Published 4 years ago

@stagas/sucrase-jest-plugin v2.2.0-fork

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Sucrase Jest plugin

npm version MIT License

This is a simple Jest plugin that makes it easy to use Sucrase when running Jest tests.

Usage

First install the package as a dev dependency:

yarn add --dev @sucrase/jest-plugin

Then change the default transform in jest.config.js file:

  ...
  transform: { "\\.(js|jsx|ts|tsx)$": "@sucrase/jest-plugin" },
  ...

Passing options to the transformer:

module.exports = {
  ...
  transform: {
    "\\.(js|jsx|ts|tsx)$": [
      "@sucrase/jest-plugin",
      { jsxPragma: "h", jsxFragment: "Fragment" }
    ],
  ...
}