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

@fatso83/mini-mocha

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fatso83/mini-mocha

A minimal emulation of Mocha

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

mini-mocha

An absolutely minimal emulation of Mocha for demos.

Why

This was hacked together very quickly for demo purposes, making it possible to verify bugs on the Sinon issue tracker without having access to a development environment. Having an API emulation of Mocha makes it easier to demo bugs on RunKit when I see a verification test using Mocha or Jasmine, as I can just copy-paste the test into RunKit, add require('@fatso83/mini-mocha').install() at the top and it will run!

Typical usage

require('@fatso83/mini-mocha').install();

describe("issue #101 ES5 version", function() {
    it("normal sync test", function() {
        // passes
    });

    it("failing test", function() {
        throw new Error("My error");
    });
});

Results in this being printed

issue #101 ES5 version: normal sync test: ✔️
issue #101 ES5 version: failing test: ❌. My error

Known limitations

There are bits and pieces missing, most notably:

  • No async support (by passing a callback or returning a promise)
  • No support for Mocha internals like this.title, this.fullTitle(), etc.

Pull requests welcome :)

Keywords

FAQs

Package last updated on 07 Mar 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