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

react-tests-globals-setup

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

react-tests-globals-setup

Setup a global fake jsdom & polyfill global Intl to make unit test environments more browser-like

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

react-tests-globals-setup

If you want to unit test react components with node & mocha, some globals need to be set up to make the environment more browser-like.

This will set up those globals.

The current version of this module uses a fake DOM provided by jsdom@3, which works with node 0.10 and 0.12. A future version will use newer jsdom and require node 4.

Usage

npm install react-tests-globals-setup --save-dev

Then add it as an argument to mocha, probably in your package.json:

  "scripts": {
    "test": "mocha --require react-tests-globals-setup"
  }

Or in mocha.opts

--require react-tests-globals-setup

Testing

npm test

## Linting

npm run lint

Keywords

FAQs

Package last updated on 06 Oct 2015

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