mocha-light
v1.0.1
Published
[![NPM version](https://badge.fury.io/js/mocha-light.svg)](http://badge.fury.io/js/mocha-light)
Downloads
2
Readme
The goal of this package was to build a light version of Mocha, within 1 day of coding. There is no real reason to use this package, except if you want to understand how Mocha works.
Table of content
Installation
Install using npm:
npm install --save-dev mocha-light
npm is the only package manager yet supported.
Getting Started
npm install --save-dev mocha-light
mkdir tests
touch tests/test.spec.js
$EDITOR tests/test.spec.js
Writing up your first test:
tests/test.spec.js
const { it } = require("mocha-light"); it("my test 1", () => { assert(true); }); it("my test 2", () => { assert(false); }); describe("my suite 1", () => { it("my test 3", () => { assert(true); }); });
Back in the terminal:
$ npx mocha-light tests/test.spec.js
Run Cycle Overview
- User (you) executes Mocha light (mocha-light [...files]).
- Mocha Light searches for the test files:
- Mocha Light builds the test Tree from the test files.
- Then executes the test Tree.
- At the end of the execution, Mocha Light shows the status of tests executions.
Command line usage
npx mocha-light [...files]