Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Update mocha from v7 to v9 #100

Merged
merged 2 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"ethereumjs-wallet": "^0.6.3",
"jsdom": "^11.12.0",
"jsdom-global": "^3.0.2",
"mocha": "^7.1.2",
"mocha": "^9.0.1",
"polyfill-crypto.getrandomvalues": "^1.0.0",
"sinon": "^7.2.7"
},
Expand Down
33 changes: 0 additions & 33 deletions test/helper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// disallow promises from swallowing errors
enableFailureOnUnhandledPromiseRejection()

const getRandomValuesPoly = require('polyfill-crypto.getrandomvalues')

//
Expand All @@ -24,33 +21,3 @@ if (!window.crypto) {
if (!window.crypto.getRandomValues) {
window.crypto.getRandomValues = getRandomValuesPoly
}

function enableFailureOnUnhandledPromiseRejection (...args) {
// modified from https://github.com/mochajs/mocha/issues/1926#issuecomment-180842722

// rethrow unhandledRejections
if (typeof process !== 'undefined') {
process.on('unhandledRejection', function (reason) {
throw reason
})
} else if (typeof window !== 'undefined') {
// 2016-02-01: No browsers support this natively, however bluebird, when.js,
// and probably other libraries do.
if (typeof window.addEventListener === 'function') {
window.addEventListener('unhandledrejection', function (evt) {
throw evt.detail.reason
})
} else {
const oldOHR = window.onunhandledrejection
window.onunhandledrejection = function (evt) {
if (typeof oldOHR === 'function') {
oldOHR.apply(this, args)
}
throw evt.detail.reason
}
}
} else if (typeof console !== 'undefined' &&
typeof (console.error || console.log) === 'function') {
(console.error || console.log)('Unhandled rejections will be ignored!')
}
}
Loading