GitXplorerGitXplorer
k

jest-css-modules-example

public
24 stars
4 forks
0 issues

Commits

List of commits on branch master.
Unverified
74d381d00922d0d3d4b52818a1b1a5b5b25bc586

oops forgot about babel-jest

kkeyz committed 8 years ago
Unverified
372ed5df0f421080e94225781f23f47da0507f5a

improved config

kkeyz committed 8 years ago
Unverified
38b5d5308f0206c285c60bf92dfe3a98116ea826

Update README.md

kkeyz committed 8 years ago
Unverified
200c1b94ca0e8f9adb30889855dd549430c9a788

initial commit

committed 8 years ago

README

The README file for this repository.

jest-css-modules-example

An example of mocking CSS Modules using an ES6 Proxy with Jest. For more information, please check https://facebook.github.io/jest/docs/tutorial-webpack.html.

tl;dr

For a component like

import React, { Component } from 'react';

import styles from './App.css';

export default class App extends Component {
  render() {
    return (
      <div className={styles.root}>
        <h1 className={styles.hello}>Hello, world!</h1>
      </div>
    );
  }
}

it generates a snapshot as below:

exports[`test App renders correctly 1`] = `
<div
  className="root">
  <h1
    className="hello">
    Hello, world!
  </h1>
</div>
`;