matheuspoleza / Jest-CSS-Modules

Jest processor that prevents CSS module parse errors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

It is unlikely that you need this library.

Read https://facebook.github.io/jest/docs/en/webpack.html to make webpack and Jest play nicely with CSS modules.

Jest CSS Modules

A Jest script processor that prevents CSS module parse errors.

Installation

npm install --save-dev jest-css-modules

Update your package.json file's jest configuration:

{
  "jest": {
    "moduleNameMapper": {
      "\\.(css)$": "<rootDir>/node_modules/jest-css-modules"
    }
  }
}

Now, imports such as import styles from './MyModule.css'; will pass through Jest without causing any pain.

Supports .css, .less, .scss and .styl extensions.

About

Jest processor that prevents CSS module parse errors


Languages

Language:JavaScript 100.0%