{"action":"created","issue":{"url":"https://api.github.com/repos/tschaub/mock-fs/issues/141","repository_url":"https://api.github.com/repos/tschaub/mock-fs","labels_url":"https://api.github.com/repos/tschaub/mock-fs/issues/141/labels{/name}","comments_url":"https://api.github.com/repos/tschaub/mock-fs/issues/141/comments","events_url":"https://api.github.com/repos/tschaub/mock-fs/issues/141/events","html_url":"https://github.com/tschaub/mock-fs/pull/141","id":164668539,"number":141,"title":"Clear the require cache before overriding fs functions","user":{"login":"tschaub","id":41094,"avatar_url":"https://avatars.githubusercontent.com/u/41094?v=3","gravatar_id":"","url":"https://api.github.com/users/tschaub","html_url":"https://github.com/tschaub","followers_url":"https://api.github.com/users/tschaub/followers","following_url":"https://api.github.com/users/tschaub/following{/other_user}","gists_url":"https://api.github.com/users/tschaub/gists{/gist_id}","starred_url":"https://api.github.com/users/tschaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschaub/subscriptions","organizations_url":"https://api.github.com/users/tschaub/orgs","repos_url":"https://api.github.com/users/tschaub/repos","events_url":"https://api.github.com/users/tschaub/events{/privacy}","received_events_url":"https://api.github.com/users/tschaub/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-07-09T14:07:48Z","updated_at":"2016-10-30T04:27:18Z","closed_at":"2016-07-09T14:39:42Z","pull_request":{"url":"https://api.github.com/repos/tschaub/mock-fs/pulls/141","html_url":"https://github.com/tschaub/mock-fs/pull/141","diff_url":"https://github.com/tschaub/mock-fs/pull/141.diff","patch_url":"https://github.com/tschaub/mock-fs/pull/141.patch"},"body":"This makes things work in cases where another module requires `fs-extra` (or similar) before `mocks-fs` is required.\r\n\r\nFixes #103.\r\n"},"comment":{"url":"https://api.github.com/repos/tschaub/mock-fs/issues/comments/257131449","html_url":"https://github.com/tschaub/mock-fs/pull/141#issuecomment-257131449","issue_url":"https://api.github.com/repos/tschaub/mock-fs/issues/141","id":257131449,"user":{"login":"not-an-aardvark","id":11638619,"avatar_url":"https://avatars.githubusercontent.com/u/11638619?v=3","gravatar_id":"","url":"https://api.github.com/users/not-an-aardvark","html_url":"https://github.com/not-an-aardvark","followers_url":"https://api.github.com/users/not-an-aardvark/followers","following_url":"https://api.github.com/users/not-an-aardvark/following{/other_user}","gists_url":"https://api.github.com/users/not-an-aardvark/gists{/gist_id}","starred_url":"https://api.github.com/users/not-an-aardvark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/not-an-aardvark/subscriptions","organizations_url":"https://api.github.com/users/not-an-aardvark/orgs","repos_url":"https://api.github.com/users/not-an-aardvark/repos","events_url":"https://api.github.com/users/not-an-aardvark/events{/privacy}","received_events_url":"https://api.github.com/users/not-an-aardvark/received_events","type":"User","site_admin":false},"created_at":"2016-10-30T04:27:18Z","updated_at":"2016-10-30T04:27:18Z","body":"I've investigated this a bit more. Here's a reproduction case that is a simplification of what our build is doing:\r\n\r\n```js\r\n// test.js\r\n\r\nrequire('./foo.js').setValue();\r\n\r\nrequire('mock-fs');\r\n\r\nassert(require('./foo.js').getValue() === true);\r\n\r\n```\r\n\r\n\r\n```js\r\n// foo.js\r\n\r\nvar value = false;\r\n\r\nmodule.exports = {\r\n  modifyValue() {\r\n    value = true;\r\n  },\r\n  getValue() {\r\n    return value;\r\n  }\r\n};\r\n```\r\n\r\nThis works with `mock-fs@3.11.0` and not with `mock-fs@3.12.0`, because `mock-fs@3.12.0` nukes the `require` cache when it loads."}}
{"actor":{"display_login":"not-an-aardvark"}}