Skip to content

Commit 72499da

Browse files
committed
Fix code duplication
1 parent 5e1b5a6 commit 72499da

File tree

2 files changed

+10
-21
lines changed

2 files changed

+10
-21
lines changed

test/helpers/emit/all.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

test/helpers/emit/main.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const { unhandledRejection } = require('./unhandled_rejection')
55
const { rejectionHandled } = require('./rejection_handled')
66
const { multipleResolves } = require('./multiple_resolves')
77
const { warning } = require('./warning')
8-
const { all } = require('./all')
98

109
const EVENTS = {
1110
uncaughtException,
@@ -15,9 +14,19 @@ const EVENTS = {
1514
warning,
1615
}
1716

17+
// Emit all process error events
18+
const all = async function() {
19+
// eslint-disable-next-line fp/no-loops
20+
for (const emitEvent of Object.values(EVENTS)) {
21+
// eslint-disable-next-line no-await-in-loop
22+
await emitEvent()
23+
}
24+
}
25+
1826
const ALL_EVENTS = { ...EVENTS, all }
1927

2028
module.exports = {
29+
all,
2130
EVENTS,
2231
ALL_EVENTS,
2332
}

0 commit comments

Comments
 (0)