1. mochainon
Opitionated way to get up and running quickly with Mocha, Chai and Sinon
mochainon
Package: mochainon
Created by: jviotti
Last modified: Mon, 20 Jun 2022 01:53:18 GMT
Version: 2.0.0
License: MIT
Downloads: 8,827
Repository: https://github.com/jviotti/mochainon

Install

npm install mochainon
yarn add mochainon

mochainon

npm version
dependencies
Build Status
Build status

Opitionated way to get up and running quickly with Mocha, Chai and Sinon.

Why?

I found myself doing the same time consuming pattern requiring Mocha, Sinon, Chai and various plugins.

This is an attempt to save a minute of my life every time I create a test file.

Future

In the future, I intend to keep extending this module with custom chai helpers and other goodies that can reduce the time I spend unit testing.

Installation

Install mochainon as a development dependency by running:

 $ npm install --save-dev mochainon

Usage

I recommend requiring this module as a single letter variable, like m, and use it's functionality from there.

Example:

 m = require('mochainon')
describe 'My Spec', ->

	it 'should pass', ->
		m.expect(true).to.be.true

Documentation

The module exposes the following objects:

mochainon.sinon

The awesome spies, stubs and mocks library SinonJS.

mochainon.chai

The powerfull assertion library Chai.

Plugins

This module also includes the following Chai plugins I use on a daily basis:

Tests

Run the test suite by doing:

 $ gulp test

Contribute

Before submitting a PR, please make sure that coffeelint runs without any warning:

 $ gulp lint

Support

If you're having any problem, please raise an issue on GitHub.

License

The project is licensed under the MIT license.

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin