payload: {"action":"created","issue":{"url":"https://api.github.com/repos/sinonjs/sinon/issues/1136","repository_url":"https://api.github.com/repos/sinonjs/sinon","labels_url":"https://api.github.com/repos/sinonjs/sinon/issues/1136/labels{/name}","comments_url":"https://api.github.com/repos/sinonjs/sinon/issues/1136/comments","events_url":"https://api.github.com/repos/sinonjs/sinon/issues/1136/events","html_url":"https://github.com/sinonjs/sinon/issues/1136","id":174857283,"node_id":"MDU6SXNzdWUxNzQ4NTcyODM=","number":1136,"title":"sinon stub- cannot stub arrow function in a class","user":{"login":"repspark-trh","id":16693806,"node_id":"MDQ6VXNlcjE2NjkzODA2","avatar_url":"https://avatars0.githubusercontent.com/u/16693806?v=4","gravatar_id":"","url":"https://api.github.com/users/repspark-trh","html_url":"https://github.com/repspark-trh","followers_url":"https://api.github.com/users/repspark-trh/followers","following_url":"https://api.github.com/users/repspark-trh/following{/other_user}","gists_url":"https://api.github.com/users/repspark-trh/gists{/gist_id}","starred_url":"https://api.github.com/users/repspark-trh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/repspark-trh/subscriptions","organizations_url":"https://api.github.com/users/repspark-trh/orgs","repos_url":"https://api.github.com/users/repspark-trh/repos","events_url":"https://api.github.com/users/repspark-trh/events{/privacy}","received_events_url":"https://api.github.com/users/repspark-trh/received_events","type":"User","site_admin":false},"labels":[{"id":168346454,"node_id":"MDU6TGFiZWwxNjgzNDY0NTQ=","url":"https://api.github.com/repos/sinonjs/sinon/labels/Documentation","name":"Documentation","color":"b322c9","default":false},{"id":958897560,"node_id":"MDU6TGFiZWw5NTg4OTc1NjA=","url":"https://api.github.com/repos/sinonjs/sinon/labels/ES2015+","name":"ES2015+","color":"f2c29b","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-02T22:12:26Z","updated_at":"2019-10-03T15:47:10Z","closed_at":"2016-09-04T14:57:39Z","author_association":"NONE","body":"- Sinon version : v2.0.0-pre.2\n- Environment   : Windows 10\n- Other libraries you are using: Typescript, babel, mocha, chai\n\n**What did you expect to happen?**\nI expected to be able to stub an arrow function in a class. \n\n**What actually happens**\nI can't stub an arrow function, however, I can stub the class prototype function. \n\n```\nFAILED TESTS:\n  ExampleClass tests\n    × should stub thisDoesntWork arrow function\n      Chrome 52.0.2743 (Windows 10 0.0.0)\n    TypeError: Attempted to wrap undefined property thisDoesntWork as function\n        at wrapMethod (webpack:///~/sinon/pkg/sinon.js:3138:0 <- test-bundler.js:7377:21)\n        at Object.stub (webpack:///~/sinon/pkg/sinon.js:2472:0 <- test-bundler.js:6711:12)\n        at Context.<anonymous> (webpack:///src/stores/sinon.test.ts:22:51 <- test-bundler.js:96197:72)\n```\n\n**How to reproduce**\n\n```\nexport class ExampleClass {\n    thisWorks() {\n        return 0;\n    }\n\n    thisDoesntWork = () => {\n        return 0;\n    }\n}\n\ndescribe(\"ExampleClass tests\", () => {\n    it(\"should stub thisWorks function\", () => {\n        let stubFunctionA = sinon.stub(ExampleClass.prototype, \"thisWorks\");\n    });\n    it(\"should stub thisDoesntWork arrow function\", () => {\n        let stubFunctionB = sinon.stub(ExampleClass, \"thisDoesntWork\");\n    });\n});\n```\n"},"comment":{"url":"https://api.github.com/repos/sinonjs/sinon/issues/comments/538003999","html_url":"https://github.com/sinonjs/sinon/issues/1136#issuecomment-538003999","issue_url":"https://api.github.com/repos/sinonjs/sinon/issues/1136","id":538003999,"node_id":"MDEyOklzc3VlQ29tbWVudDUzODAwMzk5OQ==","user":{"login":"golergka","id":929735,"node_id":"MDQ6VXNlcjkyOTczNQ==","avatar_url":"https://avatars0.githubusercontent.com/u/929735?v=4","gravatar_id":"","url":"https://api.github.com/users/golergka","html_url":"https://github.com/golergka","followers_url":"https://api.github.com/users/golergka/followers","following_url":"https://api.github.com/users/golergka/following{/other_user}","gists_url":"https://api.github.com/users/golergka/gists{/gist_id}","starred_url":"https://api.github.com/users/golergka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/golergka/subscriptions","organizations_url":"https://api.github.com/users/golergka/orgs","repos_url":"https://api.github.com/users/golergka/repos","events_url":"https://api.github.com/users/golergka/events{/privacy}","received_events_url":"https://api.github.com/users/golergka/received_events","type":"User","site_admin":false},"created_at":"2019-10-03T15:47:10Z","updated_at":"2019-10-03T15:47:10Z","author_association":"NONE","body":"Does it mean that for very arrow method my class has, I have to write additional line like this:\r\n\r\n```Typescript\r\nclassStub.methodName = sinon.stub(classStub, \"methodName\");\r\n```\r\n\r\nIs there any way to stub all the arrow functions automatically when I create the stub for the class?"}}
other: {"actor":{"display_login":"golergka"}}