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

fake-mocha

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

fake-mocha

Run arbitrary commands instead of mocha to integrate with popular IDEs

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by1100%
Maintainers
1
Weekly downloads
 
Created
Source

fake-mocha

Run arbitrary commands instead of mocha to integrate with popular IDEs

Install

npm install --save-dev fake-mocha

What? Why?

If you're developing for a production platform, chances are you're either currently running your tests in a production-like virtual machine, container, or remote dev server, or you should be.

Popular IDEs such as those in the JetBrains family -- IntelliJ IDEA, WebStorm, PHPStorm, PyCharm, etc., have excellent mocha integration for Node.js projects, provided by the optional NodeJS plugin. It provides a fantastic interface for running and exploring the results of tests, jumping right to errors or test definitions when they're clicked on.

The problem is, that mocha integration is local-only. There's no way to configure a remote run in a Docker container or a Vagrant VM, and so you're sunk if your tests require a local database, a specific version of Node.js, or some other production-like dependency.

Using fake-mocha, you can configure the mocha integration to look into node_modules/fake-mocha instead of node_modules/mocha, and in the "Extra Mocha options" section, tell it to execute your own test script. For example, if you'd prefer mocha to run make test, just set those extra options to --command "make test". Fake-mocha will ignore all the other arguments and just run the command you gave it. It will also set the working directory to your project root, pass through stdio, and exit with the same exit status code as the command it executed.

Getting the mocha integration working

Running a different command is only half the battle, and that's what fake-mocha solves for you. It's up to you to invoke actual mocha in your dev environment, and pass it the IntelliJ mocha reporter provided by the IDE plugin. See the examples folder for a Makefile that will do exactly that to run your tests in the official 'node' Docker container.

License

fake-mocha is licensed under the MIT license. Please see LICENSE.txt for full details.

Credits

fake-mocha was created in a flurry of frustration at TechnologyAdvice.

Keywords

FAQs

Package last updated on 21 Jul 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