From 9b48c597ee0c5050bdc14655914013f3e53c0cb5 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Fri, 4 Aug 2023 11:15:10 -0700 Subject: [PATCH] test(jest): reduce Jest log verbosity - make logs more compact Configure jest to override it's internal console logger with the regular console object provided by the JS runtime. This way it does not have the extra information printed that is not useful for 99% of our use-cases (100% of the known ones). Fixes #2595 Signed-off-by: Peter Somogyvari --- jest.config.js | 2 +- jest.setup.console.logs.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 jest.setup.console.logs.js diff --git a/jest.config.js b/jest.config.js index a25c68562a..f495cb2302 100644 --- a/jest.config.js +++ b/jest.config.js @@ -4,7 +4,7 @@ module.exports = { testEnvironment: "node", maxWorkers: 1, maxConcurrency: 1, - setupFilesAfterEnv: ["jest-extended/all"], + setupFilesAfterEnv: ["jest-extended/all", "./jest.setup.console.logs.js"], testTimeout: 60 * 60 * 1000, testMatch: [ `**/cactus-*/src/test/typescript/{unit,integration,benchmark}/**/*.test.ts`, diff --git a/jest.setup.console.logs.js b/jest.setup.console.logs.js new file mode 100644 index 0000000000..7e92382c72 --- /dev/null +++ b/jest.setup.console.logs.js @@ -0,0 +1,2 @@ +const console = require("node:console"); +global.console = console;