{"action":"created","issue":{"url":"https://api.github.com/repos/theKashey/rewiremock/issues/52","repository_url":"https://api.github.com/repos/theKashey/rewiremock","labels_url":"https://api.github.com/repos/theKashey/rewiremock/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/theKashey/rewiremock/issues/52/comments","events_url":"https://api.github.com/repos/theKashey/rewiremock/issues/52/events","html_url":"https://github.com/theKashey/rewiremock/issues/52","id":372501789,"node_id":"MDU6SXNzdWUzNzI1MDE3ODk=","number":52,"title":"Question: How to mock dependency’s dependency?","user":{"login":"marlun78","id":61943,"node_id":"MDQ6VXNlcjYxOTQz","avatar_url":"https://avatars3.githubusercontent.com/u/61943?v=4","gravatar_id":"","url":"https://api.github.com/users/marlun78","html_url":"https://github.com/marlun78","followers_url":"https://api.github.com/users/marlun78/followers","following_url":"https://api.github.com/users/marlun78/following{/other_user}","gists_url":"https://api.github.com/users/marlun78/gists{/gist_id}","starred_url":"https://api.github.com/users/marlun78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marlun78/subscriptions","organizations_url":"https://api.github.com/users/marlun78/orgs","repos_url":"https://api.github.com/users/marlun78/repos","events_url":"https://api.github.com/users/marlun78/events{/privacy}","received_events_url":"https://api.github.com/users/marlun78/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-22T12:34:09Z","updated_at":"2018-10-22T12:55:23Z","closed_at":"2018-10-22T12:55:23Z","author_association":"NONE","body":"Given this setup; \r\n\r\n**/client.js**\r\n```js\r\nconst client = () => { /* ... */ };\r\nmodule.exports = client;\r\n```\r\n\r\n**/router.js**\r\n```js\r\nconst client = require('./client');\r\nconst router = () => { /* ... */ };\r\nmodule.exports = router;\r\n```\r\n\r\n**/server.js**\r\n```js\r\nconst router = require('./router');\r\nconst createServer =  () => { /* ... */ };\r\nmodule.exports = { createServer };\r\n```\r\n\r\n**/server.test.js**\r\n```js\r\nconst mock = require('rewiremock').default;\r\nconst clientSpy = jasmine.createSpy('clientSpy');\r\n// This doesn’t work...\r\nconst router = mock.proxy('./router', { './client': clientSpy });\r\nconst { createServer } = mock.proxy('./server', { './router': router });\r\n// Tests\r\ndescribe('server', () => { /* ... */ });\r\n```\r\n\r\n....is there a way to mock the export of `client.js` from `server.test.js` thru `router.js`? \r\n"},"comment":{"url":"https://api.github.com/repos/theKashey/rewiremock/issues/comments/431827231","html_url":"https://github.com/theKashey/rewiremock/issues/52#issuecomment-431827231","issue_url":"https://api.github.com/repos/theKashey/rewiremock/issues/52","id":431827231,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTgyNzIzMQ==","user":{"login":"marlun78","id":61943,"node_id":"MDQ6VXNlcjYxOTQz","avatar_url":"https://avatars3.githubusercontent.com/u/61943?v=4","gravatar_id":"","url":"https://api.github.com/users/marlun78","html_url":"https://github.com/marlun78","followers_url":"https://api.github.com/users/marlun78/followers","following_url":"https://api.github.com/users/marlun78/following{/other_user}","gists_url":"https://api.github.com/users/marlun78/gists{/gist_id}","starred_url":"https://api.github.com/users/marlun78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marlun78/subscriptions","organizations_url":"https://api.github.com/users/marlun78/orgs","repos_url":"https://api.github.com/users/marlun78/repos","events_url":"https://api.github.com/users/marlun78/events{/privacy}","received_events_url":"https://api.github.com/users/marlun78/received_events","type":"User","site_admin":false},"created_at":"2018-10-22T12:55:23Z","updated_at":"2018-10-22T12:55:23Z","author_association":"NONE","body":"Actually, it does work! It was due to another issue. Sorry! 😬"}}
{"actor":{"display_login":"marlun78"}}