diff --git a/src/handle/common.js b/src/handle/common.js index 5be00af9..50994f5c 100644 --- a/src/handle/common.js +++ b/src/handle/common.js @@ -1,6 +1,5 @@ import { isLimited } from '../limit.js' import { isRepeated } from '../repeat.js' -import { isRejectionWarning } from '../warnings.js' import { getLevel } from '../level.js' import { getError, addErrorPrint } from '../error/main.js' import { exitProcess } from '../exit.js' @@ -34,10 +33,6 @@ export const handleEvent = async function({ return } - if (isRejectionWarning(name, event)) { - return - } - await logEvent({ opts, name, event }) await exitProcess({ name, opts }) diff --git a/src/warnings.js b/src/warnings.js index 53183093..877506d8 100644 --- a/src/warnings.js +++ b/src/warnings.js @@ -46,14 +46,3 @@ const getWarningListeners = function() { } const warningListener = getWarningListener() - -// Unhandled rejected promises emit a warning by default (unless -// --unhandled-rejections is used). This warning is not useful, so we remove it. -export const isRejectionWarning = function(name, { value }) { - return ( - name === 'warning' && - value instanceof Error && - value.name === 'DeprecationWarning' && - value.code === 'DEP0018' - ) -}