1.0.1 • Published 6 months ago

jest-asset-transform v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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"
  }
}
1.0.1

6 months ago

1.0.0

6 months ago