micmac
v3.0.0
Published
[![npm](https://badge.fury.io/js/micmac.svg)](https://badge.fury.io/js/micmac) [![build](https://travis-ci.org/dmail/micmac.svg?branch=master)](http://travis-ci.org/dmail/micmac) [![codecov](https://codecov.io/gh/dmail/micmac/branch/master/graph/badge.svg
Downloads
15
Readme
micmac
Mock most native way to execute JavaScript asynchonously to trigger them manually for testing.
Example
import { mockExecution } from "micmac"
mockExecution(({ tick }) => {
let called = false
new Promise((resolve) => {
setTimeout(resolve, 10)
}).then(() => {
called = true
})
called === false // no need to explain why
tick(10)
called === true // thanks to tick(10) above, check documentation to understand why
})
Check the API documentation
Install
npm i micmac