{"id":24819091,"url":"https://github.com/nitive/nightwatch-mocha-each-hooks","last_synced_at":"2025-07-22T11:03:14.388Z","repository":{"id":42703595,"uuid":"192589238","full_name":"Nitive/nightwatch-mocha-each-hooks","owner":"Nitive","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-05T13:13:40.000Z","size":235,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-22T11:03:10.022Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nitive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-18T18:01:05.000Z","updated_at":"2021-12-20T08:25:30.000Z","dependencies_parsed_at":"2025-03-25T20:38:21.801Z","dependency_job_id":"474785ec-c379-4747-a4cf-7e03110570e6","html_url":"https://github.com/Nitive/nightwatch-mocha-each-hooks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nitive/nightwatch-mocha-each-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nitive%2Fnightwatch-mocha-each-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nitive%2Fnightwatch-mocha-each-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nitive%2Fnightwatch-mocha-each-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nitive%2Fnightwatch-mocha-each-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nitive","download_url":"https://codeload.github.com/Nitive/nightwatch-mocha-each-hooks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nitive%2Fnightwatch-mocha-each-hooks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266481734,"owners_count":23935938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-30T17:56:22.118Z","updated_at":"2025-07-22T11:03:14.374Z","avatar_url":"https://github.com/Nitive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# beforeEach and afterEach hooks bug example\n\nProblem: beforeEach and afterEach hooks are not called when using mocha runner.  \nIssue: https://github.com/nightwatchjs/nightwatch/issues/1477\n\nSteps to reproduce:\n1. Install dependencies with `npm install` or `yarn install`\n2. Run `npm run nightwatch`. The output will be:\n```bash\n\u003e nightwatch\n\nGLOBAL before\nGLOBAL beforeEach\nRunning:  Demo test GitHub\n\n✔ Element \u003cbody\u003e was visible after 25 milliseconds.\n✔ Element \u003c.container h1 strong a\u003e was visible after 23 milliseconds.\n✔ Checking project title is set to nightwatch  - 25 ms.\n\nOK. 3 assertions passed. (2.581s)\nGLOBAL afterEach\nGLOBAL after\n```\nYou can see that beforeEach and afterEach hooks have been called\n3. Run `npm run mocha`. The output will be:\n\n```bash\n\u003e MOCHA=1 nightwatch\n\nGLOBAL before\n\n\n  Github\n    ✓ Demo test GitHub (1468ms)\n\n\n  1 passing (3s)\n\nGLOBAL after\n```\nbeforeEach and afterEach hooks have not been called\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitive%2Fnightwatch-mocha-each-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitive%2Fnightwatch-mocha-each-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitive%2Fnightwatch-mocha-each-hooks/lists"}