Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

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'
},
```