Skip to content

Commit c26b71e

Browse files
AmericasMiguel Martins
authored andcommitted
Bump jest dependency and fix tests
1 parent e5c8871 commit c26b71e

4 files changed

Lines changed: 2333 additions & 1540 deletions

File tree

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"scripts": {
2020
"changelog": "github-changelog-generator --owner=uphold --repo=process-manager --future-release=v$npm_package_version > CHANGELOG.md",
2121
"lint": "eslint src test",
22-
"test": "jest --coverage --runInBand --verbose",
22+
"test": "jest --coverage --verbose",
2323
"version": "npm run changelog && git add -A CHANGELOG.md"
2424
},
2525
"dependencies": {
@@ -29,9 +29,13 @@
2929
"@uphold/github-changelog-generator": "^0.4.1",
3030
"eslint": "^3.12.2",
3131
"eslint-config-seegno": "^8.0.1",
32-
"jest": "^19.0.1",
32+
"jest": "^27.5.1",
3333
"pre-commit": "^1.2.2"
3434
},
35+
"jest": {
36+
"restoreMocks": true,
37+
"testEnvironment": "node"
38+
},
3539
"engines": {
3640
"node": ">=7.6"
3741
},

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ class ProcessManager {
7777

7878
hook(type, ...args) {
7979
const hooks = this.hooks.filter(hook => hook.type === type);
80+
81+
if (hooks.length === 0) {
82+
return;
83+
}
84+
8085
const promises = hooks.map(({ handler, timeoutError }) => {
8186
return Promise.race([
8287
utils.reflect(handler, args),

0 commit comments

Comments
 (0)