Skip to content

Commit 8bcc70b

Browse files
DavertMikclaude
andcommitted
fix: restore global.Helper and global.codecept_helper lost in ESM migration
These were set in 3.x codecept.js but never ported to 4.x globals.js. Needed for CJS helpers that use `const Helper = codecept_helper`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 21844d6 commit 8bcc70b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/globals.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ export async function initCodeceptGlobals(dir, config, container) {
2525
global.output_dir = fsPath.resolve(dir, config.output)
2626

2727
if (config.noGlobals) return;
28-
// Set up actor global - will use container when available
28+
29+
const HelperModule = await import('@codeceptjs/helper')
30+
global.Helper = global.codecept_helper = HelperModule.default || HelperModule
31+
32+
// Set up actor global - will use container when available
2933
global.actor = global.codecept_actor = (obj) => {
3034
return ActorFactory(obj, container)
3135
}
@@ -109,6 +113,8 @@ export function getGlobalNames() {
109113
return [
110114
'codecept_dir',
111115
'output_dir',
116+
'Helper',
117+
'codecept_helper',
112118
'actor',
113119
'codecept_actor',
114120
'Actor',

0 commit comments

Comments
 (0)