Skip to content

czewail/remuire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Remuire

Remuire is a Node.js Runtime mock utility that extends the require method of a module

Installation

$ npm install --save-dev remuire

Node.js >= 10.12.0

Usage

// a.test.js
const remuire = require('remuire')(module)
// mock  src/a.js ===>>>>>> mock/a.js
remuire.mock('../src/a.js', './mock/a.js')

You need to mock the module before it is referenced

Explain

  1. Due to remuire's rewrite of the require module, it is not recommended for use in a production environment and is recommended for use in a unit test environment
  2. Remuire works in the global environment

LICENSE

MIT LICENSE

About

Node.js Module mock tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •