From 8e14e5daae3a5c03c544177074cc04f34aa4b2e7 Mon Sep 17 00:00:00 2001 From: Hana Date: Wed, 6 Sep 2023 11:05:11 +0800 Subject: [PATCH] chore: again --- packages/rspack/jest.config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/rspack/jest.config.js b/packages/rspack/jest.config.js index ec4cf058e6e8..aa2a92ebacec 100644 --- a/packages/rspack/jest.config.js +++ b/packages/rspack/jest.config.js @@ -5,6 +5,13 @@ process.on("unhandledRejection", (err, origin) => { console.error(err.message, err.stack, process.exitCode); }); +let old = process.exit; +process.exit = function (...args) { + const err = new Error(); + console.error(err.message, err.stack, process.exitCode); + return old.apply(this, args); +}; + ["log", "warn", "error"].forEach(methodName => { const originalMethod = console[methodName]; console[methodName] = (...args) => {