Skip to content

Commit

Permalink
Changelog for 1.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
iarna committed May 4, 2018
1 parent 593a96b commit 5bb984e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,14 @@
## v1.4.3 (2018-05-04)

Mocked module will now actually be an instance of Module (thanks [@jdalton](https://github.com/jdalton)!)

When the code loaded via `requireInject` resulted in `readable-stream` being
loaded anywhere down the require chain would produce failures in
`readable-stream`'s instanceof checks resulting in crashes. This has been
worked around by preloading `readable-stream` when it is available. This
won't fix 100% of cases but it will fix the problem most of the time. If it
doesn't fix it for you, try adding `readable-stream` as a dev dep.

## v1.4.2 (2017-06-27)

Made `mocks` in `requireInject( module, mocks )` an optional argument.
Expand Down
6 changes: 6 additions & 0 deletions index.js
Expand Up @@ -3,6 +3,12 @@ var Module = require('module')
var path = require('path')
var caller = require('caller')

try {
require('readable-stream')
} catch (_) {
// ignore error, just doing the require to work around weirdness in readable-stream
}

exports = module.exports = function (toLoad, mocks) {
return requireInject(toLoad, mocks)
}
Expand Down

0 comments on commit 5bb984e

Please sign in to comment.