{"action":"created","issue":{"url":"https://api.github.com/repos/mysticatea/abort-controller/issues/7","repository_url":"https://api.github.com/repos/mysticatea/abort-controller","labels_url":"https://api.github.com/repos/mysticatea/abort-controller/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/mysticatea/abort-controller/issues/7/comments","events_url":"https://api.github.com/repos/mysticatea/abort-controller/issues/7/events","html_url":"https://github.com/mysticatea/abort-controller/issues/7","id":313026953,"number":7,"title":"TypeError: Class extends value undefined ... when importing","user":{"login":"lsiden","id":136536,"avatar_url":"https://avatars2.githubusercontent.com/u/136536?v=4","gravatar_id":"","url":"https://api.github.com/users/lsiden","html_url":"https://github.com/lsiden","followers_url":"https://api.github.com/users/lsiden/followers","following_url":"https://api.github.com/users/lsiden/following{/other_user}","gists_url":"https://api.github.com/users/lsiden/gists{/gist_id}","starred_url":"https://api.github.com/users/lsiden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsiden/subscriptions","organizations_url":"https://api.github.com/users/lsiden/orgs","repos_url":"https://api.github.com/users/lsiden/repos","events_url":"https://api.github.com/users/lsiden/events{/privacy}","received_events_url":"https://api.github.com/users/lsiden/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-04-10T17:51:19Z","updated_at":"2018-05-16T16:58:00Z","closed_at":null,"author_association":"NONE","body":"When I attempt to run tests with jest, Node throws:\r\n\r\n    TypeError: Class extends value undefined is not a constructor or null\r\n\r\n    > 1 | import { AbortController } from \"abort-controller\"\r\n      2 | import { ToastStyles } from \"react-native-toaster\"\r\n\r\nThis still works in the run-time app.\r\n\r\nI tried mocking it out in the test with\r\n\r\n    jest.mock(\"abort-controller\")\r\n\r\nbut it doesn't make a difference."},"comment":{"url":"https://api.github.com/repos/mysticatea/abort-controller/issues/comments/389591420","html_url":"https://github.com/mysticatea/abort-controller/issues/7#issuecomment-389591420","issue_url":"https://api.github.com/repos/mysticatea/abort-controller/issues/7","id":389591420,"user":{"login":"lsiden","id":136536,"avatar_url":"https://avatars2.githubusercontent.com/u/136536?v=4","gravatar_id":"","url":"https://api.github.com/users/lsiden","html_url":"https://github.com/lsiden","followers_url":"https://api.github.com/users/lsiden/followers","following_url":"https://api.github.com/users/lsiden/following{/other_user}","gists_url":"https://api.github.com/users/lsiden/gists{/gist_id}","starred_url":"https://api.github.com/users/lsiden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsiden/subscriptions","organizations_url":"https://api.github.com/users/lsiden/orgs","repos_url":"https://api.github.com/users/lsiden/repos","events_url":"https://api.github.com/users/lsiden/events{/privacy}","received_events_url":"https://api.github.com/users/lsiden/received_events","type":"User","site_admin":false},"created_at":"2018-05-16T16:57:59Z","updated_at":"2018-05-16T16:57:59Z","author_association":"NONE","body":"Okay,  thanks.\n\nOn Tue, May 15, 2018 at 1:27 AM Toru Nagashima <notifications@github.com>\nwrote:\n\n> Toru, I don't know how to write tests for logic that makes asynchronous\n> requests (HTTP) without writing mocks. I just didn't expect to have to\n> write a mock for abort-controller and event-target-shim.\n>\n> I don't say \"don't use mocks\", but I suspect that jest's mock system has a\n> critical defect that messes library to replace indirect dependencies with\n> undefined.\n>\n> The problems appears to be that the node.js interpreter detects a circular\n> reference when loading abort-controller.js and throws a run-time error.\n>\n> No. Any circular references don't exist in this library. I think that Jest\n> hacks and overwrites Node.js's module loading behavior and it messes\n> require(\"event-target-shim\") of this library. Mock libraries need such\n> hacks. But sane mocks would not replace internal dependencies with\n> undefined silently.\n>\n> You might want to consider using babel to transpile the .js files in both\n> libraries into ES5 for the dist/ directory for maximum compatibility.\n>\n> I don't think that I want to inflate the source code as unnecessary.\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/mysticatea/abort-controller/issues/7#issuecomment-389046987>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AAIVWDN8dEIpmqsMBV6nqT8bpzgX947Uks5tymc3gaJpZM4TOuG4>\n> .\n>\n"}}
{"actor":{"display_login":"lsiden"}}