{"action":"created","issue":{"url":"https://api.github.com/repos/davidchambers/doctest/issues/70","labels_url":"https://api.github.com/repos/davidchambers/doctest/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/davidchambers/doctest/issues/70/comments","events_url":"https://api.github.com/repos/davidchambers/doctest/issues/70/events","html_url":"https://github.com/davidchambers/doctest/issues/70","id":129905944,"number":70,"title":"How to test a function that returns a Promise","user":{"login":"zhangchiqing","id":811374,"avatar_url":"https://avatars.githubusercontent.com/u/811374?v=3","gravatar_id":"","url":"https://api.github.com/users/zhangchiqing","html_url":"https://github.com/zhangchiqing","followers_url":"https://api.github.com/users/zhangchiqing/followers","following_url":"https://api.github.com/users/zhangchiqing/following{/other_user}","gists_url":"https://api.github.com/users/zhangchiqing/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangchiqing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangchiqing/subscriptions","organizations_url":"https://api.github.com/users/zhangchiqing/orgs","repos_url":"https://api.github.com/users/zhangchiqing/repos","events_url":"https://api.github.com/users/zhangchiqing/events{/privacy}","received_events_url":"https://api.github.com/users/zhangchiqing/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-29T22:57:08Z","updated_at":"2016-01-31T01:49:29Z","closed_at":"2016-01-31T01:49:29Z","body":"I want to test a function that returns a Promise\r\nI expect this test case to fail, but it passed. Do I miss anything here?\r\n```\r\n// > resolve(2)\r\n// Promise.resolve(3);\r\nfunction resolve(x) {\r\n  return Promise.resolve(x);\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/davidchambers/doctest/issues/comments/177356813","html_url":"https://github.com/davidchambers/doctest/issues/70#issuecomment-177356813","issue_url":"https://api.github.com/repos/davidchambers/doctest/issues/70","id":177356813,"user":{"login":"davidchambers","id":210406,"avatar_url":"https://avatars.githubusercontent.com/u/210406?v=3","gravatar_id":"","url":"https://api.github.com/users/davidchambers","html_url":"https://github.com/davidchambers","followers_url":"https://api.github.com/users/davidchambers/followers","following_url":"https://api.github.com/users/davidchambers/following{/other_user}","gists_url":"https://api.github.com/users/davidchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/davidchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidchambers/subscriptions","organizations_url":"https://api.github.com/users/davidchambers/orgs","repos_url":"https://api.github.com/users/davidchambers/repos","events_url":"https://api.github.com/users/davidchambers/events{/privacy}","received_events_url":"https://api.github.com/users/davidchambers/received_events","type":"User","site_admin":false},"created_at":"2016-01-31T01:49:29Z","updated_at":"2016-01-31T01:49:29Z","body":"> Then it would mean that a function returns a `Promise`, which is asynchronous, would be untestable for doctest. no?\r\n\r\nCorrect. Testing asynchronous functions is out of scope for this project.\r\n\r\nThanks for finding and reporting a bug in Ramda, though! I've opened a pull request to fix it.\r\n"}}