@moxy/jest-config-web

6.1.0 • Public • Published

jest-config-web

NPM version Downloads Dependency status Dev Dependency status

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 mock className 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(),
);

Package Sidebar

Install

npm i @moxy/jest-config-web

Weekly Downloads

10

Version

6.1.0

License

MIT

Unpacked Size

4.33 kB

Total Files

4

Last publish

Collaborators

  • tiagodinis
  • moxyhq
  • filipediasf
  • satazor
  • marcooliveira
  • acostalima
  • andregoncalvesdev