@@ -60,21 +60,23 @@ describe('Workers', function () {
6060 const workerConfig = {
6161 by : createTestGroups ,
6262 testConfig : './test/data/sandbox/codecept.customworker.js' ,
63+ options : {
64+ override : JSON . stringify ( {
65+ helpers : {
66+ FileSystem : { } ,
67+ Workers : {
68+ require : './workers_helper' ,
69+ } ,
70+ CustomWorkers : {
71+ require : './custom_worker_helper' ,
72+ } ,
73+ } ,
74+ } ) ,
75+ } ,
6376 }
6477
6578 const workers = new Workers ( - 1 , workerConfig )
6679
67- for ( const worker of workers . getWorkers ( ) ) {
68- worker . addConfig ( {
69- helpers : {
70- FileSystem : { } ,
71- Workers : {
72- require : './custom_worker_helper.js' ,
73- } ,
74- } ,
75- } )
76- }
77-
7880 workers . run ( )
7981
8082 workers . on ( event . all . result , result => {
@@ -110,7 +112,7 @@ describe('Workers', function () {
110112 // Clean up event listeners
111113 workers . removeListener ( event . test . failed , onTestFailed )
112114 workers . removeListener ( event . test . passed , onTestPassed )
113-
115+
114116 // The main assertion is that workers ran and some tests failed (indicating they executed)
115117 expect ( result . hasFailed ) . equal ( true )
116118 // In test suite context, event counting has timing issues, but functionality works
@@ -141,7 +143,10 @@ describe('Workers', function () {
141143 helpers : {
142144 FileSystem : { } ,
143145 Workers : {
144- require : './custom_worker_helper.js' ,
146+ require : './workers_helper' ,
147+ } ,
148+ CustomWorkers : {
149+ require : './custom_worker_helper' ,
145150 } ,
146151 } ,
147152 } )
@@ -176,7 +181,10 @@ describe('Workers', function () {
176181 helpers : {
177182 FileSystem : { } ,
178183 Workers : {
179- require : './custom_worker_helper.js' ,
184+ require : './workers_helper' ,
185+ } ,
186+ CustomWorkers : {
187+ require : './custom_worker_helper' ,
180188 } ,
181189 } ,
182190 } )
@@ -233,7 +241,7 @@ describe('Workers', function () {
233241 testConfig : './test/data/sandbox/codecept.non-test-events-worker.js' ,
234242 }
235243
236- let workers = new Workers ( 2 , workerConfig )
244+ let workers = new Workers ( 2 , workerConfig )
237245
238246 workers . run ( )
239247
0 commit comments