{"action":"closed","issue":{"url":"https://api.github.com/repos/isaacs/node-tap/issues/137","labels_url":"https://api.github.com/repos/isaacs/node-tap/issues/137/labels{/name}","comments_url":"https://api.github.com/repos/isaacs/node-tap/issues/137/comments","events_url":"https://api.github.com/repos/isaacs/node-tap/issues/137/events","html_url":"https://github.com/isaacs/node-tap/issues/137","id":80893035,"number":137,"title":"Support for promises in mocha-like tests","user":{"login":"bajtos","id":1140553,"avatar_url":"https://avatars.githubusercontent.com/u/1140553?v=3","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-05-26T10:06:47Z","updated_at":"2015-12-30T23:48:38Z","closed_at":"2015-12-30T23:48:38Z","body":"The Mocha framework detects when a test returns a promise, which allows developers to write asynchronous tests without repeating `if (err) return done(err)` all over the place (see https://github.com/mochajs/mocha/pull/329):\r\n\r\n```js\r\nit('reads file via promise', function() {\r\n  return fs.readFileAsync('foo.txt')\r\n    .then(function(text) {\r\n      expect(text).to.contain('foo');\r\n    });\r\n  });\r\n});\r\n// the test runner waits until the returned promise is resolved\r\n```\r\n\r\nI am proposing to implement this support in node-tap too, I am happy to contribute the implementation myself.\r\n\r\nThoughts?"}}