From 7371d051d7eab827be2cfd40858ce73eee980fc2 Mon Sep 17 00:00:00 2001 From: Hana Date: Fri, 1 Sep 2023 16:42:35 +0800 Subject: [PATCH] chore: init diagnose --- packages/rspack/jest.config.js | 9 +++++++++ packages/rspack/testProcessor.js | 4 ++++ 2 files changed, 13 insertions(+) create mode 100644 packages/rspack/testProcessor.js diff --git a/packages/rspack/jest.config.js b/packages/rspack/jest.config.js index d53d10ef1459..ea8eec2876ee 100644 --- a/packages/rspack/jest.config.js +++ b/packages/rspack/jest.config.js @@ -1,3 +1,10 @@ +process.on("uncaughtException", (err, origin) => { + console.error(err.message, err.stack, process.exitCode); +}); +process.on("unhandledRejection", (err, origin) => { + console.error(err.message, err.stack, process.exitCode); +}); + /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ const config = { testEnvironment: "../../scripts/test/patch-node-env.cjs", @@ -10,6 +17,8 @@ const config = { "/tests/WatchSuspend.test.js" ], testTimeout: process.env.CI ? 120000 : 30000, + testResultsProcessor: "./testProcessor.js", + verbose: true, cache: false, transform: { "^.+\\.tsx?$": [ diff --git a/packages/rspack/testProcessor.js b/packages/rspack/testProcessor.js new file mode 100644 index 000000000000..e99a37bb59d2 --- /dev/null +++ b/packages/rspack/testProcessor.js @@ -0,0 +1,4 @@ +module.exports = function (result) { + console.log(JSON.stringify(result, null, 2)); + return result; +};