Skip to content

Commit 82f194a

Browse files
committed
fix: more runner tests
1 parent 67a2e07 commit 82f194a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/command/list.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export default async function (path) {
99
const testsPath = getTestRoot(path)
1010
const config = await getConfig(testsPath)
1111
const codecept = new Codecept(config, {})
12-
codecept.init(testsPath)
12+
await codecept.init(testsPath)
13+
await container.started()
1314

1415
output.print('List of test actions: -- ')
1516
const helpers = container.helpers()

lib/mocha/ui.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ import { createSuite } from './suite.js'
88
import { HookConfig, AfterSuiteHook, AfterHook, BeforeSuiteHook, BeforeHook } from './hooks.js'
99
import { initMochaGlobals } from '../globals.js'
1010
import common from 'mocha/lib/interfaces/common.js'
11+
import container from '../container.js'
1112

1213
const setContextTranslation = context => {
13-
if (!global.container) return
14-
const contexts = global.container.translation?.value?.('contexts')
14+
// Try global container first, then local container instance
15+
const containerToUse = global.container || container
16+
if (!containerToUse) return
17+
18+
const translation = containerToUse.translation?.() || containerToUse.translation
19+
const contexts = translation?.value?.('contexts')
1520

1621
if (contexts) {
1722
for (const key of Object.keys(contexts)) {

0 commit comments

Comments
 (0)