New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mocha-react-native

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-react-native

mocha-react-native

  • 0.2.0
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

mocha-react-native

This is a collection of helpers to get Mocha tests working nicely with React Native projects. It includes runtime babel transformations, aliasing imports and mocking modules.

How to use

$ npm install mocha-react-native

Create a file in your project: test/mocha.opts

Paste the following into that file.

--compilers js:mocha-react-native/init

Advanced

Add an alias or mock a react-native module:

Create a file in your project: test/mocks.js

Add some code using addAlias and/or addMock:

import {addAlias, addMock} from 'mocha-react-native';
addAlias('react-native-linear-gradient', 'actual-empty-object');
addMock('exponent', {
  Font: {
    style: () => ({fontFamily: ''}),
  },
});

Tell mocha about that file by adding a line to test/mocha.opts:

--compilers js:mocha-react-native/init
--require ./test/mocks.js

License

This software is ICS licensed.

Keywords

FAQs

Package last updated on 28 Oct 2016

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