Skip to content

Commit 53c17e0

Browse files
Copilotkobenguyent
andcommitted
Changes before error encountered
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
1 parent c5b8aa6 commit 53c17e0

File tree

118 files changed

+150
-247
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+150
-247
lines changed

lib/command/run-multiple.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import { fork } from 'child_process'
22
import path from 'path'
33
import crypto from 'crypto'
4+
import { fileURLToPath } from 'url'
45

56
import runHook from '../hooks.js'
67
import event from '../event.js'
78
import collection from './run-multiple/collection.js'
89
import { clearString, replaceValueDeep } from '../utils.js'
910
import { getConfig, getTestRoot, fail } from './utils.js'
1011

12+
const __filename = fileURLToPath(import.meta.url)
13+
const __dirname = path.dirname(__filename)
1114
const runner = path.join(__dirname, '/../../bin/codecept')
1215
let config
1316
const childOpts = {}

lib/mocha/factory.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@ import reporter from './cli.js'
66
import gherkinParser from './gherkin.js'
77
import output from '../output.js'
88
import ConnectionRefused from '../helper/errors/ConnectionRefused.js'
9+
import scenarioInterface from './ui.js'
910

1011
const __filename = fileURLToPath(import.meta.url)
1112
const __dirname = fsPath.dirname(__filename)
12-
const scenarioUi = fsPath.join(__dirname, './ui.js')
1313

1414
let mocha
1515

1616
class MochaFactory {
1717
static create(config, opts) {
1818
mocha = new Mocha(Object.assign(config, opts))
1919
output.process(opts.child)
20-
mocha.ui(scenarioUi)
20+
21+
// Register the scenario interface directly instead of using file path
22+
mocha.ui(function(suite) {
23+
scenarioInterface(suite);
24+
})
2125
// mocha.ui('bdd')
2226

2327
Mocha.Runner.prototype.uncaught = function (err) {

lib/workers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const initializeCodecept = (configPath, options = {}) => {
3535
const createOutputDir = configPath => {
3636
const config = mainConfig.loadSync(configPath || '.')
3737
const testRoot = getTestRoot(configPath)
38-
const outputDir = path.isAbsolute(config.output) ? config.output : path.join(testRoot, config.output)
38+
const outputDir = config.output ? (path.isAbsolute(config.output) ? config.output : path.join(testRoot, config.output)) : path.join(testRoot, './output')
3939

4040
if (!fileExists(outputDir)) {
4141
output.print(`creating output directory: ${outputDir}`)

runok.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ import path from 'path'
44
import axios from 'axios'
55
import { execSync } from 'node:child_process'
66
import semver from 'semver'
7-
import runok, {
8-
stopOnFail,
9-
chdir,
10-
tasks: { git, copy, exec, replaceInFile, npmRun, npx, writeToFile },
11-
} from 'runok'
7+
import runok, { stopOnFail, chdir, tasks } from 'runok'
8+
const { git, copy, exec, replaceInFile, npmRun, npx, writeToFile } = tasks
129

1310
let documentation
1411

test/data/inject-fail-example/codecept.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exports.config = {
1+
export const config = {
22
tests: './*_test.js',
33
output: './output',
44
helpers: {

test/data/sandbox/codecept.addt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exports.config = {
1+
export const config = {
22
tests: './*_test.addt.js',
33
timeout: 10000,
44
output: './output',

test/data/sandbox/codecept.async.bootstrapall.multiple.code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import event from '../../../lib/event.js'
22

3-
exports.config = {
3+
export const config = {
44
tests: './*_test.js',
55
timeout: 10000,
66
output: './output',

test/data/sandbox/codecept.bdd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exports.config = {
1+
export const config = {
22
tests: './*_no_test.js',
33
timeout: 10000,
44
output: './output',

test/data/sandbox/codecept.beforetest.failure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exports.config = {
1+
export const config = {
22
tests: './*test_before_failure.js',
33
timeout: 10000,
44
output: './output',

test/data/sandbox/codecept.bootstrapall.multiple.code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exports.config = {
1+
export const config = {
22
tests: './*_test.js',
33
timeout: 10000,
44
output: './output',

0 commit comments

Comments
 (0)