An open API service indexing awesome lists of open source software.

https://github.com/keyz/jest-css-modules-example


https://github.com/keyz/jest-css-modules-example

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

jest-css-modules-example
=====================

An example of mocking CSS Modules using an [ES6 Proxy](https://github.com/keyanzhang/identity-obj-proxy) with [Jest](https://facebook.github.io/jest). For more information, please check https://facebook.github.io/jest/docs/tutorial-webpack.html.

## tl;dr

For a component like
```js
import React, { Component } from 'react';

import styles from './App.css';

export default class App extends Component {
render() {
return (


Hello, world!



);
}
}
```

it generates a snapshot as below:
```js
exports[`test App renders correctly 1`] = `



Hello, world!



`;
```