sindresorhus / clear-module

Clear a module from the cache
MIT License
182 stars 25 forks source link

Doesn't work for mongoose #6

Closed oprogramador closed 5 years ago

oprogramador commented 5 years ago

Issuehunt badges

For other libraries it's OK but I have problems with clearing mongoose.

OS: Mac OS X 10.12.6 Node.js: 10.13.0 clear-module: 3.0.0 mongoose: 5.3.13

const mongoose = require('mongoose');
const clearModule = require('clear-module');

clearModule('mongoose');
console.log(require('mongoose') === mongoose); // I expect false but it's true

IssueHunt Summary #### [omrilotan omrilotan](https://issuehunt.io/u/omrilotan) has been rewarded. ### Backers (Total: $40.00) - [issuehunt issuehunt](https://issuehunt.io/u/issuehunt) ($40.00) ### Submitted pull Requests - [#9 Clear modules recursively](https://issuehunt.io/r/sindresorhus/clear-module/pull/9) --- ### Tips - Checkout the [Issuehunt explorer](https://issuehunt.io/r/sindresorhus/clear-module/) to discover more funded issues. - Need some help from other developers? [Add your repositories](https://issuehunt.io/r/new) on IssueHunt to raise funds. --- IssueHunt has been backed by the following sponsors. [Become a sponsor](https://issuehunt.io/membership/members)
oprogramador commented 5 years ago

this https://github.com/sindresorhus/clear-module/pull/7 should fix

IssueHuntBot commented 5 years ago

@issuehunt has funded $40.00 to this issue.


oprogramador commented 5 years ago

@IssuehuntBot

I opened this PR https://github.com/sindresorhus/clear-module/pull/7 but it was rejected.

sindresorhus commented 5 years ago

@oprogramador #7 was not the correct way to fix the issue. I commented that in the PR.

issuehunt-oss[bot] commented 5 years ago

@sindresorhus has rewarded $36.00 to @omrilotan. See it on IssueHunt