add jest setup file to improve test logging

This commit is contained in:
Nacho Codoñer
2025-08-07 11:51:23 +02:00
parent aecc1a0fac
commit 170f4bf872
2 changed files with 10 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ module.exports = {
preset: 'jest-playwright-preset',
rootDir: __dirname,
testMatch: ["**/*.test.js"],
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
verbose: true,
// Increase timeout for CLI operations
testTimeout: 60_000,

View File

@@ -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}`));
});