bahmutov / bahmutov/cache-require-paths

Does not play nice with mockery

Open
#8 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
126
Forks
8
PR merge metrics
No merged PRs in 30d

Description

In my test code I'm registering a substitute module for `electron`.

When I enable `cache-require-paths` it will never use the substituted module, and instead error:

`Error: Cannot find module 'electron'`

``` js
require("cache-require-paths")

var mockery = require("mockery")
mockery.enable()
mockery.registerSubstitute("electron", "./electron_stub")

require("electron") // <-- bomb
```

This will work if I remove `cache-require-paths`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.