@@ -23,11 +23,36 @@ const Codecept = require(process.env.CODECEPT_CLASS_PATH || '../../codecept')
2323const { options, tests, testRoot, workerIndex, poolMode } = workerData
2424
2525// hide worker output
26- if ( ! options . debug && ! options . verbose )
26+ // In pool mode, always hide worker output to prevent duplicate output
27+ // In regular mode, hide result output but allow step output in verbose/debug
28+ if ( poolMode || ( ! options . debug && ! options . verbose ) ) {
2729 process . stdout . write = string => {
2830 stdout += string
2931 return true
3032 }
33+ } else {
34+ // In verbose/debug mode for test/suite modes, show step details
35+ // but suppress individual worker result summaries to avoid duplicate output
36+ const originalWrite = process . stdout . write
37+ const originalConsoleLog = console . log
38+
39+ process . stdout . write = string => {
40+ // Suppress individual worker result summaries and failure reports
41+ if ( string . includes ( ' FAIL |' ) || string . includes ( ' OK |' ) || string . includes ( '-- FAILURES:' ) || string . includes ( 'AssertionError:' ) || string . includes ( '◯ File:' ) || string . includes ( '◯ Scenario Steps:' ) ) {
42+ return true
43+ }
44+ return originalWrite . call ( process . stdout , string )
45+ }
46+
47+ // Override console.log to catch result summaries
48+ console . log = ( ...args ) => {
49+ const fullMessage = args . join ( ' ' )
50+ if ( fullMessage . includes ( ' FAIL |' ) || fullMessage . includes ( ' OK |' ) || fullMessage . includes ( '-- FAILURES:' ) ) {
51+ return
52+ }
53+ return originalConsoleLog . apply ( console , args )
54+ }
55+ }
3156
3257const overrideConfigs = tryOrDefault ( ( ) => JSON . parse ( options . override ) , { } )
3358
0 commit comments