{"action":"opened","issue":{"url":"https://api.github.com/repos/danielstjules/mocha.parallel/issues/40","repository_url":"https://api.github.com/repos/danielstjules/mocha.parallel","labels_url":"https://api.github.com/repos/danielstjules/mocha.parallel/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/danielstjules/mocha.parallel/issues/40/comments","events_url":"https://api.github.com/repos/danielstjules/mocha.parallel/issues/40/events","html_url":"https://github.com/danielstjules/mocha.parallel/issues/40","id":298435651,"number":40,"title":"AfterEach unregistered by parallel","user":{"login":"ze6ke","id":10391174,"avatar_url":"https://avatars1.githubusercontent.com/u/10391174?v=4","gravatar_id":"","url":"https://api.github.com/users/ze6ke","html_url":"https://github.com/ze6ke","followers_url":"https://api.github.com/users/ze6ke/followers","following_url":"https://api.github.com/users/ze6ke/following{/other_user}","gists_url":"https://api.github.com/users/ze6ke/gists{/gist_id}","starred_url":"https://api.github.com/users/ze6ke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ze6ke/subscriptions","organizations_url":"https://api.github.com/users/ze6ke/orgs","repos_url":"https://api.github.com/users/ze6ke/repos","events_url":"https://api.github.com/users/ze6ke/events{/privacy}","received_events_url":"https://api.github.com/users/ze6ke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-20T00:19:13Z","updated_at":"2018-02-20T00:19:13Z","closed_at":null,"author_association":"NONE","body":"I hope that my posting issues is taken as appreciation of a good library and not idle complaining.\r\n\r\nIt appears that parallel unregisters afterEach functions so that they aren't applied to suites registered after parallel is called.  In the example below, I would expect afterEach to be called twice, once for the parallel test and once for the final test.  But, it's not called on the final test.  If you change the parallel suite to a describe suite, afterEach is called twice.\r\n\r\n```\r\nconst parallel = require('mocha.parallel')\r\n\r\nafterEach(function () {\r\n  console.log('afterEach called')\r\n})\r\n\r\nparallel('parallel suite', function () {\r\n  it('parallel test', function () {\r\n    console.log('parallel test run')\r\n  })\r\n})\r\n\r\ndescribe('suite 2', function () {\r\n  it('final test', function () {\r\n    console.log('final test run')\r\n  })\r\n})\r\n```\r\n\r\nFWIW, my use case is that I'm doing integration testing and have a function that store screen shots for each test that failed."}}
{"actor":{"display_login":"ze6ke"}}