From 170f4bf872995a3d8937c8392efb8a5501805fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Thu, 7 Aug 2025 11:51:23 +0200 Subject: [PATCH] add jest setup file to improve test logging --- tools/modern-tests/jest.config.js | 1 + tools/modern-tests/jest.setup.js | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 tools/modern-tests/jest.setup.js diff --git a/tools/modern-tests/jest.config.js b/tools/modern-tests/jest.config.js index b40a943b70..41e0609c2a 100644 --- a/tools/modern-tests/jest.config.js +++ b/tools/modern-tests/jest.config.js @@ -2,6 +2,7 @@ module.exports = { preset: 'jest-playwright-preset', rootDir: __dirname, testMatch: ["**/*.test.js"], + setupFilesAfterEnv: ['/jest.setup.js'], verbose: true, // Increase timeout for CLI operations testTimeout: 60_000, diff --git a/tools/modern-tests/jest.setup.js b/tools/modern-tests/jest.setup.js new file mode 100644 index 0000000000..83590326d1 --- /dev/null +++ b/tools/modern-tests/jest.setup.js @@ -0,0 +1,9 @@ +// jest.setup.js +import chalk from 'chalk'; + +// This runs before each test +beforeEach(() => { + const name = expect.getState().currentTestName; + // e.g. a bright cyan arrow and test name + console.log(chalk.cyan(`▶ ${name}`)); +});