{"push_id":691618518,"size":3,"distinct_size":3,"ref":"refs/heads/teardown","head":"42f2ff85056a254d846df565d87a1d235d220326","before":"68f7684cda09aa56ea8c5edb1399c38d6ddad0d2","commits":[{"sha":"a2ad2915cb06c384a4fad4529d5cf5ea211137b8","author":{"email":"042dc4512fa3d391c5170cf3aa61e6a638f84342@izs.me","name":"isaacs"},"message":"Add t.tearDown(function), t.autoend()\n\nThis one is a bit of a sticky API puzzle.\n\nWe run tests synchronously, and the root tap object is automatically\nended when the process exits.\n\nHowever, in a situation like this, the process will never exit:\n\n    tap.tearDown(function () {\n      server.close()\n    })\n\nbecause the server will keep it open.\n\nTo avoid this problem, what we do is automatically end when there is\nnothing in the queue.  The autoend is scheduled in a timeout that in\nturn sets another timeout.  This gives us a bit of a chance to add more\ntests in this tick (or the very next one) but any delay-added tests once\nan autoexit is triggered will be lost.\n\nSo, in a situation like this:\n\n    tap.tearDown(function () {\n      console.log('ended...')\n    })\n\n    tap.pass('this is ok')\n\n    setTimeout(function () {\n      tap.pass('this is lost')\n    }, 100)\n\nthe `'this is lost'` test point is never printed, because we've already\nhit the `autoend` which triggered the teardown.\n\nIt seems relatively unlikely to have both slowly asynchronously added\ntests, *and also* a tearDown function, and any expectation that that\ncould ever work, since it would require knowledge of the future, and\nmost tap users have watched a few time travel movies and are aware that\nthis module does not change the laws of causality.\n\nNevertheless, we may need to figure out a good solution to this if it\ntrips people up.  The compromises in this commit make it pass tests for\n`st` which uses it in a very conventional way.\n\nThanks to @aredridel for rubber-ducking this in the #npm irc channel.","distinct":true,"url":"https://api.github.com/repos/isaacs/node-tap/commits/a2ad2915cb06c384a4fad4529d5cf5ea211137b8"},{"sha":"7fb70945d6cc2802448b4b734890b09357d199bb","author":{"email":"042dc4512fa3d391c5170cf3aa61e6a638f84342@izs.me","name":"isaacs"},"message":"Keep the skip reason from 1..0 child tests","distinct":true,"url":"https://api.github.com/repos/isaacs/node-tap/commits/7fb70945d6cc2802448b4b734890b09357d199bb"},{"sha":"42f2ff85056a254d846df565d87a1d235d220326","author":{"email":"042dc4512fa3d391c5170cf3aa61e6a638f84342@izs.me","name":"isaacs"},"message":"Add afterEach, beforeEach","distinct":true,"url":"https://api.github.com/repos/isaacs/node-tap/commits/42f2ff85056a254d846df565d87a1d235d220326"}]}