{"action":"opened","issue":{"url":"https://api.github.com/repos/substack/tape/issues/177","labels_url":"https://api.github.com/repos/substack/tape/issues/177/labels{/name}","comments_url":"https://api.github.com/repos/substack/tape/issues/177/comments","events_url":"https://api.github.com/repos/substack/tape/issues/177/events","html_url":"https://github.com/substack/tape/issues/177","id":102032170,"number":177,"title":"Allow test.plan to take a callback argument called after test.end()","user":{"login":"chrisirhc","id":132584,"avatar_url":"https://avatars.githubusercontent.com/u/132584?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisirhc","html_url":"https://github.com/chrisirhc","followers_url":"https://api.github.com/users/chrisirhc/followers","following_url":"https://api.github.com/users/chrisirhc/following{/other_user}","gists_url":"https://api.github.com/users/chrisirhc/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisirhc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisirhc/subscriptions","organizations_url":"https://api.github.com/users/chrisirhc/orgs","repos_url":"https://api.github.com/users/chrisirhc/repos","events_url":"https://api.github.com/users/chrisirhc/events{/privacy}","received_events_url":"https://api.github.com/users/chrisirhc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-20T00:48:55Z","updated_at":"2015-08-20T00:48:55Z","closed_at":null,"body":"This allows asynchronous tests to do clean up after the last assertion is called.\r\n\r\nIdeally, a syntax like this would work:\r\n\r\n```\r\ntest('async test', function (t) {\r\n  t.plan(1, teardown);\r\n\r\n  setTimeout(function () {\r\n    t.ok(true, 'Yay');\r\n  }, 1000)\r\n\r\n  function teardown() {\r\n    console.log('called at the end');\r\n  }\r\n\r\n});\r\n```\r\n\r\nCurrently, I don't think there's any other way to do this besides creating a stream and listening for the end."}}