@nhz.io/mini-mock
v1.0.2
Published
Patch require() to return mocks
Downloads
7
Readme
Install
npm i -D @nhz.io/mini-mock
Usage
// will-get-mock.js
const someModule = require('some-module')
...
// will-get-real.js
const someModule = require('some-module')
...
// test.js
require('@nhz.io/mini-mock')
module.mock('some-module', 'Mocked value')
require('./will-get-mock.js')
module.unmock('some-module')
require('./will-get-real.js')
...