{"action":"created","issue":{"url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/378","labels_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/378/labels{/name}","comments_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/378/comments","events_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/378/events","html_url":"https://github.com/kriasoft/react-starter-kit/issues/378","id":124898978,"number":378,"title":"TypeError: Cannot read property 'apply' of undefined","user":{"login":"flysonic10","id":1060968,"avatar_url":"https://avatars.githubusercontent.com/u/1060968?v=3","gravatar_id":"","url":"https://api.github.com/users/flysonic10","html_url":"https://github.com/flysonic10","followers_url":"https://api.github.com/users/flysonic10/followers","following_url":"https://api.github.com/users/flysonic10/following{/other_user}","gists_url":"https://api.github.com/users/flysonic10/gists{/gist_id}","starred_url":"https://api.github.com/users/flysonic10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flysonic10/subscriptions","organizations_url":"https://api.github.com/users/flysonic10/orgs","repos_url":"https://api.github.com/users/flysonic10/repos","events_url":"https://api.github.com/users/flysonic10/events{/privacy}","received_events_url":"https://api.github.com/users/flysonic10/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-05T05:27:54Z","updated_at":"2016-01-05T05:40:43Z","closed_at":null,"body":"After setting up tests with Jest and getting through the auto-mocking issues described in #264, I'm getting:\r\n\r\n```TypeError: Cannot read property 'apply' of undefined\r\n        at StyledComponent.componentWillMount (decorators/withStyles.js:19:50)```\r\n\r\nThe specific line in the withStyles decorator causing the error is: \r\n\r\n`this.removeCss = this.context.insertCss.apply(undefined, styles);`\r\n\r\ninsertCss is undefined. How can the context be passed into the decorator for testing?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/comments/168904633","html_url":"https://github.com/kriasoft/react-starter-kit/issues/378#issuecomment-168904633","issue_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/378","id":168904633,"user":{"login":"flysonic10","id":1060968,"avatar_url":"https://avatars.githubusercontent.com/u/1060968?v=3","gravatar_id":"","url":"https://api.github.com/users/flysonic10","html_url":"https://github.com/flysonic10","followers_url":"https://api.github.com/users/flysonic10/followers","following_url":"https://api.github.com/users/flysonic10/following{/other_user}","gists_url":"https://api.github.com/users/flysonic10/gists{/gist_id}","starred_url":"https://api.github.com/users/flysonic10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flysonic10/subscriptions","organizations_url":"https://api.github.com/users/flysonic10/orgs","repos_url":"https://api.github.com/users/flysonic10/repos","events_url":"https://api.github.com/users/flysonic10/events{/privacy}","received_events_url":"https://api.github.com/users/flysonic10/received_events","type":"User","site_admin":false},"created_at":"2016-01-05T05:40:43Z","updated_at":"2016-01-05T05:40:43Z","body":"For now, I patched it with\r\n\r\n```\r\nimport emptyFunction from '../../node_modules/fbjs/lib/emptyFunction';\r\n\r\n...\r\n\r\n    const insertCss = this.context.insertCss || emptyFunction;\r\n    this.removeCss = insertCss.apply(undefined, styles);```"}}