Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ayusharma/jest-css-module-transformer
A Jest transformer for css and scss files
https://github.com/ayusharma/jest-css-module-transformer
css javascript jest postcss scss transformer
Last synced: 3 months ago
JSON representation
A Jest transformer for css and scss files
- Host: GitHub
- URL: https://github.com/ayusharma/jest-css-module-transformer
- Owner: ayusharma
- License: mit
- Created: 2020-05-02T21:01:04.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T04:52:06.000Z (about 2 years ago)
- Last Synced: 2024-10-19T15:59:42.133Z (3 months ago)
- Topics: css, javascript, jest, postcss, scss, transformer
- Language: JavaScript
- Homepage:
- Size: 1.05 MB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Jest css module transformer
---
This package provides a mock to `*.scss` & `*.css` files and keeps the class names intact in Jest snapshot**Original markup**:
```html
...
```
**Snapshot markup without transformation**:
```html
...
```
**Snapshot markup with transformation**:
```html
...
```### Installation
```shell script
yarn add --dev @ayusharma/jest-css-module-transformer
```Or
```shell script
npm install --save-dev @ayusharma/jest-css-module-transformer
```### Use
Add the following entry in Jest configuration file.
```javascript
transform: {
'^.+\\.(css|scss)$': '@ayusharma/jest-css-module-transformer'
},
```