mock-require
mock-require copied to clipboard
Simple, intuitive mocking of Node.js modules.
Clarify that `mock` must be called before requiring the corresponding module.
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.4 to 4.17.15. Commits - [`ddfd9b1`](https://github.com/lodash/lodash/commit/ddfd9b11a0126db2302cb70ec9973b66baec0975) Bump to v4.17.15. - [`b185fce`](https://github.com/lodash/lodash/commit/b185fcee26b2133bd071f4aaca14b455c2ed1008) Rebuild lodash and docs. - [`be87d30`](https://github.com/lodash/lodash/commit/be87d303941222b97c482755afc0f4a77ce46c30) Bump to v4.17.14. - [`a6fe6b1`](https://github.com/lodash/lodash/commit/a6fe6b1e174fd02b5e60eb2664405f4c1262c300) Rebuild lodash and docs. -...
I needed to scan a directory and generate mock requires without knowing which order to require them in. I added a lazy flag so the order could be determined at...
We hit an issue of subsequencing tests keep loading previously mocked dependency. It stops only if we add `reRequire(moduleInQuestion)` after previous test finished running to clear out cache: testA.js ```javascript...
Bumps [eslint](https://github.com/eslint/eslint) from 4.15.0 to 4.18.2. Release notes *Sourced from [eslint's releases](https://github.com/eslint/eslint/releases).* > ## v4.18.2 > * 6b71fd0 Fix: [email protected], because 4.0.3 needs "ajv": "^6.0.1" ([#10022](https://github-redirect.dependabot.com/eslint/eslint/issues/10022)) (Mathieu Seiler) > *...
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.10.0 to 3.13.1. Changelog *Sourced from [js-yaml's changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md).* > 3.13.1 / 2019-04-05 > ------------------- > > - Fix possible code execution in (already unsafe) `.load()`, [#480](https://github-redirect.dependabot.com/nodeca/js-yaml/issues/480). >...
It's not easy to learn what new features or fixes landed with given version updates, or even more importantly what were breaking changes with given major (is it safe for...
This change fixes #36 by making `require.resolve` explicit in where it is resolving from. It therefore prevents collisions with files in `mock-require`, which are themselves in the `NODE_PATH`, triggering the...
When trying to `reRequire` a file named `index` that is in the local path, `reRequire` will instead return what `mock-require` exports, specifically the `startMocking` function. Example code: index.js: ``` const...