{"action":"created","issue":{"url":"https://api.github.com/repos/sindresorhus/ava/issues/37","labels_url":"https://api.github.com/repos/sindresorhus/ava/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/ava/issues/37/comments","events_url":"https://api.github.com/repos/sindresorhus/ava/issues/37/events","html_url":"https://github.com/sindresorhus/ava/issues/37","id":105078495,"number":37,"title":"Generators support","user":{"login":"vdemedes","id":697676,"avatar_url":"https://avatars.githubusercontent.com/u/697676?v=3","gravatar_id":"","url":"https://api.github.com/users/vdemedes","html_url":"https://github.com/vdemedes","followers_url":"https://api.github.com/users/vdemedes/followers","following_url":"https://api.github.com/users/vdemedes/following{/other_user}","gists_url":"https://api.github.com/users/vdemedes/gists{/gist_id}","starred_url":"https://api.github.com/users/vdemedes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdemedes/subscriptions","organizations_url":"https://api.github.com/users/vdemedes/orgs","repos_url":"https://api.github.com/users/vdemedes/repos","events_url":"https://api.github.com/users/vdemedes/events{/privacy}","received_events_url":"https://api.github.com/users/vdemedes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-09-06T08:15:50Z","updated_at":"2015-09-06T12:48:32Z","closed_at":null,"body":"Would be very useful and insanely cool, if AVA supported generators by default. I am ready to implement this right away. What does everyone think of that?"},"comment":{"url":"https://api.github.com/repos/sindresorhus/ava/issues/comments/138080782","html_url":"https://github.com/sindresorhus/ava/issues/37#issuecomment-138080782","issue_url":"https://api.github.com/repos/sindresorhus/ava/issues/37","id":138080782,"user":{"login":"vdemedes","id":697676,"avatar_url":"https://avatars.githubusercontent.com/u/697676?v=3","gravatar_id":"","url":"https://api.github.com/users/vdemedes","html_url":"https://github.com/vdemedes","followers_url":"https://api.github.com/users/vdemedes/followers","following_url":"https://api.github.com/users/vdemedes/following{/other_user}","gists_url":"https://api.github.com/users/vdemedes/gists{/gist_id}","starred_url":"https://api.github.com/users/vdemedes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdemedes/subscriptions","organizations_url":"https://api.github.com/users/vdemedes/orgs","repos_url":"https://api.github.com/users/vdemedes/repos","events_url":"https://api.github.com/users/vdemedes/events{/privacy}","received_events_url":"https://api.github.com/users/vdemedes/received_events","type":"User","site_admin":false},"created_at":"2015-09-06T12:48:32Z","updated_at":"2015-09-06T12:48:32Z","body":"@MadcapJake yield with `co` is basically the same as async/await:\r\n\r\n```js\r\nfunction promiseFn () {\r\n  return Promise.resolve('some value');\r\n}\r\n\r\nasync function asyncFn () {\r\n  return Promise.resolve('some value');\r\n}\r\n\r\nyield promiseFn(); // 'some value'\r\nawait asyncFn(); // 'some value'\r\n```\r\n\r\nYou would use generators in a test just like you are using promises or anything else now, nothing is changing really:\r\n\r\n```js\r\ntest ('content of the file', function * (t) {\r\n  let content = yield fs.readFile('/path/to/file', 'utf-8');\r\n\r\n  t.same(content, 'expected file content');\r\n});\r\n```"}}