@stagas/sucrase-jest-plugin
v2.2.0-fork
Published
Fork - Jest plugin for Sucrase
Downloads
2
Readme
Sucrase Jest plugin
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" }
],
...
}