New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tinymocha

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinymocha

A minimalistic test framework that supports a subset of Mocha

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

Tinymocha

This is a minimalistic version of the Mocha test framework, with a DSL that is a subset of the Mocha DSL.

Installation

npm install tinymocha

and in your code:

import {describe, it, beforeEach} from "tinymocha"

or

var tinymocha = require("tinymocha");
var describe = tinymocha.describe
var it = tinymocha.it
var beforeEach = tinymocha.beforeEach

The rest is just Mocha syntax.

Features

Tinymocha can be used either in the browser or or in Node. In Node it properly sets process.exitCode, so it can be used in test frameworks and CI.

It only supports one-level deep describe blocks. So no describe in describe is supported.

Tinymocha outputs results of test cases and headings of test suites by console.log and console.error calls.

Asynchronity is supported but only with promises (not with done callbacks). So just as in Mocha, test cases can return Promise objects (or thenables) and Tinymocha will wait for them to be resolved or rejected.

Participation

Bug reports, feature requests and pull requests are welcome on GitHub :)

License

MIT

FAQs

Package last updated on 27 Sep 2021

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