{"action":"created","issue":{"url":"https://api.github.com/repos/leobalter/goiabada/issues/16","labels_url":"https://api.github.com/repos/leobalter/goiabada/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/leobalter/goiabada/issues/16/comments","events_url":"https://api.github.com/repos/leobalter/goiabada/issues/16/events","html_url":"https://github.com/leobalter/goiabada/issues/16","id":63053995,"number":16,"title":"async/await support","user":{"login":"jaydson","id":72206,"avatar_url":"https://avatars.githubusercontent.com/u/72206?v=3","gravatar_id":"","url":"https://api.github.com/users/jaydson","html_url":"https://github.com/jaydson","followers_url":"https://api.github.com/users/jaydson/followers","following_url":"https://api.github.com/users/jaydson/following{/other_user}","gists_url":"https://api.github.com/users/jaydson/gists{/gist_id}","starred_url":"https://api.github.com/users/jaydson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaydson/subscriptions","organizations_url":"https://api.github.com/users/jaydson/orgs","repos_url":"https://api.github.com/users/jaydson/repos","events_url":"https://api.github.com/users/jaydson/events{/privacy}","received_events_url":"https://api.github.com/users/jaydson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-19T18:04:09Z","updated_at":"2015-03-19T18:13:53Z","closed_at":null,"body":"I'd love async/await support for async code.\r\nTo test something today, as i can see, we need to do something like that:\r\n```javascript\r\ngoiabada.test( assert => {\r\n    assert.ok( true, \"it works!\" );\r\n    assert.end();\r\n});\r\n```\r\nMy proposal using async/await:\r\n```javascript\r\nlet assert = await goiabada.test(\"basics\");\r\nawait assert.ok(true, \"it works!\");\r\nawait assert.equal( 1, \"1\", \"equal assertion pass\" );\r\n```\r\nI didn't look deeply at the Goibada code yet, but i don't think it will be so hard to implement something like my proposal.\r\n\r\nThoughts here? \r\n//cc @leobalter @UltCombo"},"comment":{"url":"https://api.github.com/repos/leobalter/goiabada/issues/comments/83698183","html_url":"https://github.com/leobalter/goiabada/issues/16#issuecomment-83698183","issue_url":"https://api.github.com/repos/leobalter/goiabada/issues/16","id":83698183,"user":{"login":"leobalter","id":301201,"avatar_url":"https://avatars.githubusercontent.com/u/301201?v=3","gravatar_id":"","url":"https://api.github.com/users/leobalter","html_url":"https://github.com/leobalter","followers_url":"https://api.github.com/users/leobalter/followers","following_url":"https://api.github.com/users/leobalter/following{/other_user}","gists_url":"https://api.github.com/users/leobalter/gists{/gist_id}","starred_url":"https://api.github.com/users/leobalter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leobalter/subscriptions","organizations_url":"https://api.github.com/users/leobalter/orgs","repos_url":"https://api.github.com/users/leobalter/repos","events_url":"https://api.github.com/users/leobalter/events{/privacy}","received_events_url":"https://api.github.com/users/leobalter/received_events","type":"User","site_admin":false},"created_at":"2015-03-19T18:13:53Z","updated_at":"2015-03-19T18:13:53Z","body":"TBQH, I need to read the documentation on async/await, but that leads me to some questions:\r\n\r\ncurrently, `test` returns a promise, with the test results. \r\n\r\n```js\r\ngoiabada.test(\"basics\").then( results => { ... } );\r\n```\r\n\r\nMaybe this should change to something more useful, maybe returning the assert object given at the test should be better:\r\n\r\n```js\r\ngoiabada.test(\"basics\", t => {\r\n  setTimeout( () => {\r\n    t.ok(true);\r\n    t.end();\r\n  });\r\n).then( t => {\r\n  t.ok(true);\r\n  t.end();\r\n});\r\n```\r\n\r\n---\r\n\r\nWhere I believe the await method should fit is the test runner function. In other words, replacing the generator for a proper async function.\r\n\r\n\r\n"}}