jest-asset-transform
v1.0.1
Published
A Jest transformer which enables importing assets into Jest's jsdom.
Downloads
1,515
Maintainers
Readme
jest-asset-transform
A Jest transformer which enables importing assets into Jest's jsdom.
Description
This is a custom Jest transformer turning file imports into filenames.
Note: SVG handling is mainly inspired from jest-transformer-svg.
Getting started
Installation
Install with NPM or Yarn.
Run npm install jest-asset-transform -D
or yarn add jest-asset-transform -D
to install the library.
Usage
Please add the transformation module into the Jest's transform config:
{
"transform": {
"\\.[jt]sx?$": "babel-jest",
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": "jest-asset-transform"
}
}