Socket
Socket
Sign inDemoInstall

@ayusharma/jest-css-module-transformer

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ayusharma/jest-css-module-transformer

A jest preprocessor for css and scss files


Version published
Maintainers
1
Install size
6.04 kB
Created

Readme

Source

Jest css module transformer

This package provides a mock to *.scss & *.css files and keeps the class names intact in Jest snapshot

Original markup:

    <div class=`container ${css.marginAuto}`>
        <section class=`${css.blogSection}`>...</section>
    </div>

Snapshot markup without transformation:

    <div class="container undefined">
        <section class="undefined">...</section>
    </div>

Snapshot markup with transformation:

    <div class="container marginAuto">
        <section class="blogSection">...</section>
    </div>

Installation

    yarn add --dev @ayusharma/jest-css-module-transformer

Or

    npm install --save-dev @ayusharma/jest-css-module-transformer

Use

Add the following entry in Jest configuration file.

    transform: {
        '^.+\\.(css|scss)$': '@ayusharma/jest-css-module-transformer'
    },

Keywords

FAQs

Last updated on 03 May 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc