@moxy/jest-config-web
v6.1.0
Published
MOXY's Jest configuration enhancer for web projects
Downloads
32
Readme
jest-config-web
MOXY's Jest configuration enhancer for Web projects.
Installation
$ npm install --save-dev jest @moxy/jest-config-base @moxy/jest-config-web
This package should be used in conjunction with @moxy/jest-config-base
.
What's included?
- Transform: Allows importing common files used for the web, such as fonts, images and videos. It also maps files ending in
.data-url.<ext>
and.inline.<ext>
into their base64 data URL and raw content respectively, a convention we are using in next-with-moxy and other Webpack based projects. - Module name mapping: Maps
.css
files to an identity object, to correctly mockclassName
lookups when using CSS Modules.
Usage
To use this enhancer, use the compose
function that comes with this package. Keep in mind, the first item should always be the base configuration!
const { compose, baseConfig } = require('@moxy/jest-config-base');
const withWeb = require('@moxy/jest-config-web');
module.exports = compose(
baseConfig(),
withWeb(),
);