{"action":"created","issue":{"url":"https://api.github.com/repos/theKashey/rewiremock/issues/40","repository_url":"https://api.github.com/repos/theKashey/rewiremock","labels_url":"https://api.github.com/repos/theKashey/rewiremock/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/theKashey/rewiremock/issues/40/comments","events_url":"https://api.github.com/repos/theKashey/rewiremock/issues/40/events","html_url":"https://github.com/theKashey/rewiremock/pull/40","id":358053221,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzOTE3MTc3","number":40,"title":"Catch TypeError: Cannot read property 'call' of undefined","user":{"login":"suro1995","id":8684036,"node_id":"MDQ6VXNlcjg2ODQwMzY=","avatar_url":"https://avatars1.githubusercontent.com/u/8684036?v=4","gravatar_id":"","url":"https://api.github.com/users/suro1995","html_url":"https://github.com/suro1995","followers_url":"https://api.github.com/users/suro1995/followers","following_url":"https://api.github.com/users/suro1995/following{/other_user}","gists_url":"https://api.github.com/users/suro1995/gists{/gist_id}","starred_url":"https://api.github.com/users/suro1995/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suro1995/subscriptions","organizations_url":"https://api.github.com/users/suro1995/orgs","repos_url":"https://api.github.com/users/suro1995/repos","events_url":"https://api.github.com/users/suro1995/events{/privacy}","received_events_url":"https://api.github.com/users/suro1995/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-07T12:46:57Z","updated_at":"2018-09-07T12:51:38Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/theKashey/rewiremock/pulls/40","html_url":"https://github.com/theKashey/rewiremock/pull/40","diff_url":"https://github.com/theKashey/rewiremock/pull/40.diff","patch_url":"https://github.com/theKashey/rewiremock/pull/40.patch"},"body":"#### The issue\r\nTypeError: Cannot read property 'call' of undefined\r\n\r\nCaused by webpack. Sometimes is does not include some important files. To solve this problem just import('rewiremock/webpack/interceptor') in scaffolding. The problem is simply - this file does not exists in the bundle.\r\n\r\n#### My idea\r\nThe above error is described in readme, but the suggested solution is not that perfect. \r\nI could always repro the error if:\r\n* rewiremock plugin is added to webpack config\r\n* test code does not import rewiremock\r\n\r\nThis case is so common. The following are some possible scenarios:\r\n* I may not need to mock anything for now, but I want the mocking infrastructure there. \r\n* I have a project with some tests and mocks working well. But I dont want to get this error if I comment out all the test files.\r\n* Similar case would be, I have a number of loaders for different file types in webpack config, but I may not actually have all the file types. \r\n\r\nSo it would be better if the rewiremock plugin does not make any assumption that rewiremock must exist in the bundle. In this way we decouple the infrastructure and the application code, and increase flexibility.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/theKashey/rewiremock/issues/comments/419429561","html_url":"https://github.com/theKashey/rewiremock/pull/40#issuecomment-419429561","issue_url":"https://api.github.com/repos/theKashey/rewiremock/issues/40","id":419429561,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTQyOTU2MQ==","user":{"login":"codecov[bot]","id":22429695,"node_id":"MDM6Qm90MjI0Mjk2OTU=","avatar_url":"https://avatars2.githubusercontent.com/in/254?v=4","gravatar_id":"","url":"https://api.github.com/users/codecov%5Bbot%5D","html_url":"https://github.com/apps/codecov","followers_url":"https://api.github.com/users/codecov%5Bbot%5D/followers","following_url":"https://api.github.com/users/codecov%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/codecov%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/codecov%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codecov%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/codecov%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/codecov%5Bbot%5D/repos","events_url":"https://api.github.com/users/codecov%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/codecov%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-09-07T12:51:38Z","updated_at":"2018-09-07T12:51:38Z","author_association":"NONE","body":"# [Codecov](https://codecov.io/gh/theKashey/rewiremock/pull/40?src=pr&el=h1) Report\n> Merging [#40](https://codecov.io/gh/theKashey/rewiremock/pull/40?src=pr&el=desc) into [master](https://codecov.io/gh/theKashey/rewiremock/commit/cf279f2a2ddce0d1acac10ce51df46080a13c05a?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/theKashey/rewiremock/pull/40/graphs/tree.svg?width=650&token=SIL4Tfnj0l&height=150&src=pr)](https://codecov.io/gh/theKashey/rewiremock/pull/40?src=pr&el=tree)\n\n```diff\n@@           Coverage Diff           @@\n##           master      #40   +/-   ##\n=======================================\n  Coverage   93.35%   93.35%           \n=======================================\n  Files          85       85           \n  Lines        1656     1656           \n=======================================\n  Hits         1546     1546           \n  Misses        110      110\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/theKashey/rewiremock/pull/40?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/theKashey/rewiremock/pull/40?src=pr&el=footer). Last update [cf279f2...c2ae8c5](https://codecov.io/gh/theKashey/rewiremock/pull/40?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"}}
{"actor":{"display_login":"codecov"}}