{"action":"created","issue":{"url":"https://api.github.com/repos/segmentio/localstorage-retry/issues/14","repository_url":"https://api.github.com/repos/segmentio/localstorage-retry","labels_url":"https://api.github.com/repos/segmentio/localstorage-retry/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/segmentio/localstorage-retry/issues/14/comments","events_url":"https://api.github.com/repos/segmentio/localstorage-retry/issues/14/events","html_url":"https://github.com/segmentio/localstorage-retry/issues/14","id":360901797,"node_id":"MDU6SXNzdWUzNjA5MDE3OTc=","number":14,"title":"ReferenceError: window is not defined","user":{"login":"lvl99","id":238480,"node_id":"MDQ6VXNlcjIzODQ4MA==","avatar_url":"https://avatars0.githubusercontent.com/u/238480?v=4","gravatar_id":"","url":"https://api.github.com/users/lvl99","html_url":"https://github.com/lvl99","followers_url":"https://api.github.com/users/lvl99/followers","following_url":"https://api.github.com/users/lvl99/following{/other_user}","gists_url":"https://api.github.com/users/lvl99/gists{/gist_id}","starred_url":"https://api.github.com/users/lvl99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvl99/subscriptions","organizations_url":"https://api.github.com/users/lvl99/orgs","repos_url":"https://api.github.com/users/lvl99/repos","events_url":"https://api.github.com/users/lvl99/events{/privacy}","received_events_url":"https://api.github.com/users/lvl99/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-17T14:41:15Z","updated_at":"2018-09-25T20:02:47Z","closed_at":null,"author_association":"NONE","body":"Attempting to run some tests with jest (CRA) and I get the following error:\r\n\r\n```\r\nTest suite failed to run\r\n\r\n    ReferenceError: window is not defined\r\n\r\n      at Object.<anonymous> (node_modules/@segment/localstorage-retry/lib/schedule.js:12:9)\r\n      at Object.<anonymous> (node_modules/@segment/localstorage-retry/lib/index.js:6:16)\r\n```\r\n\r\nWhen looking at the code for [`lib/schedule.js`](https://github.com/segmentio/localstorage-retry/blob/0632fb943fc111b6dbf8f36bff5abc6568ffc65e/lib/schedule.js#L7-L12) it references `window.setTimeout`, `window.clearTimeout` and `window.Date`. I think this can conflict with jest's mocking of the `window` object and timer functions."},"comment":{"url":"https://api.github.com/repos/segmentio/localstorage-retry/issues/comments/424481561","html_url":"https://github.com/segmentio/localstorage-retry/issues/14#issuecomment-424481561","issue_url":"https://api.github.com/repos/segmentio/localstorage-retry/issues/14","id":424481561,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDQ4MTU2MQ==","user":{"login":"f2prateek","id":843979,"node_id":"MDQ6VXNlcjg0Mzk3OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/843979?v=4","gravatar_id":"","url":"https://api.github.com/users/f2prateek","html_url":"https://github.com/f2prateek","followers_url":"https://api.github.com/users/f2prateek/followers","following_url":"https://api.github.com/users/f2prateek/following{/other_user}","gists_url":"https://api.github.com/users/f2prateek/gists{/gist_id}","starred_url":"https://api.github.com/users/f2prateek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f2prateek/subscriptions","organizations_url":"https://api.github.com/users/f2prateek/orgs","repos_url":"https://api.github.com/users/f2prateek/repos","events_url":"https://api.github.com/users/f2prateek/events{/privacy}","received_events_url":"https://api.github.com/users/f2prateek/received_events","type":"User","site_admin":false},"created_at":"2018-09-25T20:02:47Z","updated_at":"2018-09-25T20:02:47Z","author_association":"MEMBER","body":"(sorry accidentiallly hit the close button)"}}
{"actor":{"display_login":"f2prateek"}}