-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
On this line we are checking that the set of unhandled rejection listeners on the process matches a single-element set with the one listener we expect to be there:
winston/test/rejection-handler.test.js
Line 102 in 955dffa
| assume(process.listeners('unhandledRejection')).deep.equals([ |
Mocha 8.2.0 introduced a change over 8.1.3 which adds a global listener for unhandled promise rejections which precedes the expected one in the set and makes the set a different size than what is expected. This breaks this test.
To fix the test, instead of comparing the set of global listeners to a fixed expected set, we should iterate over the listeners in the global set and just verify that the expected one is in there, ignoring any others that might also be.
Alongside this, the version of Mocha listed under devDependencies in package.json should be updated to 8.2.0. Then also test with the latest version of Mocha and if it still works, update that all the way to whatever the current version is.