https://github.com/keyz/jest-css-modules-example
https://github.com/keyz/jest-css-modules-example
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/keyz/jest-css-modules-example
- Owner: keyz
- License: mit
- Created: 2016-08-03T02:00:10.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-04T21:37:30.000Z (almost 10 years ago)
- Last Synced: 2025-05-03T00:28:40.753Z (about 1 year ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 24
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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!
`;
```