Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-module-proxy

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-module-proxy

An identity object for mocking imports inside Jest tests.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

jest-module-proxy · npm Build Status codecov

An identity object for mocking imports inside Jest tests. A drop-in replacement for identity-obj-proxy that works with modern Babel.

Getting Started

yarn add -D jest-module-proxy

Add the following to your Jest config:

"moduleNameMapper": {
  "\\.css$": "jest-module-proxy"
},

And for a React component like this:

import React from 'react';
import styles from './App.module.css';

export default () => (
    <div className={styles.root}>
        <h1 className={styles.hello}>Hello, world!</h1>
    </div>
);
exports[`App renders correctly 1`] = `
<div
  class="root"
>
  <h1
    class="hello"
  >
    Hello, world!
  </h1>
</div>
`;

Keywords

FAQs

Package last updated on 22 Jan 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc