Skip to content

Commit 26c0fe3

Browse files
author
codeceptjs-bot
committed
chore: sync docs, unified API and releases from CodeceptJS
1 parent c6152da commit 26c0fe3

5 files changed

Lines changed: 34 additions & 22 deletions

File tree

src/content/docs/configuration.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,18 @@ For TypeScript test files in CodeceptJS 4.x, use the [`tsx`](https://tsx.is) loa
6868
// codecept.conf.ts
6969
export const config = {
7070
tests: './**/*_test.ts',
71-
require: ['tsx/cjs'],
71+
require: ['tsx/esm'],
7272
helpers: {},
7373
include: {},
7474
}
7575
```
7676

77+
This requires `"type": "module"` in `package.json` so `.ts` test files are compiled as ES Modules.
78+
7779
Combine several modules:
7880

7981
```ts
80-
require: ['tsx/cjs', 'should', './lib/testSetup']
82+
require: ['tsx/esm', 'should', './lib/testSetup']
8183
```
8284

8385
The config file itself (`codecept.conf.ts`) and helpers are transpiled automatically — only test files need the loader. See [TypeScript](/typescript) for the full setup.

src/content/docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ npm i tsx --save-dev
108108
// codecept.conf.ts
109109
export const config = {
110110
tests: './**/*_test.ts',
111-
require: ['tsx/cjs'], // loads the *_test.ts files
111+
require: ['tsx/esm'], // loads the *_test.ts files as ES Modules (needs "type": "module")
112112
helpers: {
113113
Playwright: { url: 'http://localhost', browser: 'chromium' },
114114
},

src/content/docs/parallel.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ import { Workers, event } from 'codeceptjs'
113113
const workers = new Workers(null, { testConfig: './codecept.conf.js' })
114114
115115
// split the suite into 2 groups, run each group on two browsers
116-
const groups = workers.createGroupsOfSuites(2)
116+
const groups = await workers.createGroupsOfSuites(2)
117117
for (const browser of ['chromium', 'firefox']) {
118118
for (const group of groups) {
119119
const worker = workers.spawn()
@@ -136,7 +136,7 @@ try {
136136
Building blocks:
137137

138138
- `new Workers(N, { testConfig, options })` — `N` workers; pass `null` to spawn them yourself with `spawn()`.
139-
- `createGroupsOfTests(n)` / `createGroupsOfSuites(n)` — split the suite into `n` groups.
139+
- `await createGroupsOfTests(n)` / `await createGroupsOfSuites(n)` — split the suite into `n` groups (async: test files are loaded as ES Modules).
140140
- `worker.addTests(group)` / `worker.addConfig(partialConfig)` — assign tests and config overrides to a spawned worker.
141141
- `bootstrapAll()` → `run()` → `teardownAll()` — lifecycle (wrap `run()` in `try/finally` so teardown always runs).
142142
- Events on the `workers` object: `event.test.passed`, `event.test.failed`, `event.all.result`, plus `'message'` for anything a child worker sends. `printResults()` prints the standard summary; `result.hasFailed()` and `result.stats` give the totals.

src/content/docs/release.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@ description: Latest CodeceptJS releases, pulled from GitHub.
44
---
55
<!-- Auto-generated by bunosh release:pull from codeceptjs/CodeceptJS GitHub Releases. Do not edit. -->
66

7+
## [4.1.0](https://github.com/codeceptjs/CodeceptJS/releases/tag/4.1.0)
8+
9+
_Released 2026-07-30_
10+
11+
### What's Changed
12+
* Fixes run-rerun by @DenysKuchma in https://github.com/codeceptjs/CodeceptJS/pull/5667
13+
* fix(core): load Mocha test files as ES Modules (fixes internal-API imports from tests, #5636) by @DavertMik in https://github.com/codeceptjs/CodeceptJS/pull/5640
14+
* chore(deps): bump @xmldom/xmldom from 0.9.8 to 0.9.10 by @ElVisPL in https://github.com/codeceptjs/CodeceptJS/pull/5651
15+
* fix(appium): replace deprecated setNetworkConnection/getNetworkConnection with mobile: setConnectivity/getConnectivity by @mirao in https://github.com/codeceptjs/CodeceptJS/pull/5662
16+
* fix(typings): add ARIA locators to ILocator by @patryk-przybysz in https://github.com/codeceptjs/CodeceptJS/pull/5665
17+
* chore(deps-dev): bump eslint-plugin-mocha from 11.2.0 to 11.3.0 by @dependabot[bot] in https://github.com/codeceptjs/CodeceptJS/pull/5629
18+
* chore(deps-dev): bump graphql from 16.12.0 to 16.14.2 by @dependabot[bot] in https://github.com/codeceptjs/CodeceptJS/pull/5627
19+
* chore(deps): bump monocart-coverage-reports from 2.12.9 to 2.12.12 by @dependabot[bot] in https://github.com/codeceptjs/CodeceptJS/pull/5625
20+
21+
### New Contributors
22+
* @ElVisPL made their first contribution in https://github.com/codeceptjs/CodeceptJS/pull/5651
23+
* @patryk-przybysz made their first contribution in https://github.com/codeceptjs/CodeceptJS/pull/5665
24+
25+
**Full Changelog**: https://github.com/codeceptjs/CodeceptJS/compare/4.0.9...4.1.0
26+
727
## [4.0.8](https://github.com/codeceptjs/CodeceptJS/releases/tag/4.0.8)
828

929
_Released 2026-06-17_
@@ -170,15 +190,3 @@ _Released 2026-05-14_
170190

171191

172192
**Full Changelog**: https://github.com/codeceptjs/CodeceptJS/compare/4.0.0-rc.22...4.0.0-rc.23
173-
174-
## [4.0.0-rc.22](https://github.com/codeceptjs/CodeceptJS/releases/tag/4.0.0-rc.22) _(pre-release)_
175-
176-
_Released 2026-05-13_
177-
178-
### What's Changed
179-
* fix(playwright): replace constructor.name checks with stable public API (#5559) by @mirao in https://github.com/codeceptjs/CodeceptJS/pull/5560
180-
* fix(workers): do not exit worker on unhandled rejections by @gololdf1sh in https://github.com/codeceptjs/CodeceptJS/pull/5561
181-
* feat(plugin): JUnit XML reporter plugin with steps & meta by @DavertMik in https://github.com/codeceptjs/CodeceptJS/pull/5558
182-
183-
184-
**Full Changelog**: https://github.com/codeceptjs/CodeceptJS/compare/4.0.0-rc.21...4.0.0-rc.22

src/content/docs/typescript.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ CodeceptJS ships [type declarations](https://github.com/codeceptjs/CodeceptJS/tr
1212
? Do you plan to write tests in TypeScript? Yes
1313
```
1414

15-
It writes `codecept.conf.ts` and `*_test.ts` files. The **config file** and helpers are transpiled automatically. **Test files** need a loader — CodeceptJS 4.x is ESM, and Mocha loads test files through CommonJS hooks, so use [`tsx`](https://tsx.is) (fast, esbuild-based, no `tsconfig.json` required):
15+
It writes `codecept.conf.ts` and `*_test.ts` files. The **config file** and helpers are transpiled automatically. **Test files** need a loader — CodeceptJS 4.x is ESM and loads test files as ES Modules, so use [`tsx`](https://tsx.is) (fast, esbuild-based, no `tsconfig.json` required):
1616

1717
```sh
1818
npm i tsx --save-dev
@@ -22,16 +22,16 @@ npm i tsx --save-dev
2222
// codecept.conf.ts
2323
export const config = {
2424
tests: './**/*_test.ts',
25-
require: ['tsx/cjs'], // loads the *_test.ts files
25+
require: ['tsx/esm'], // loads the *_test.ts files as ES Modules
2626
helpers: {
2727
Playwright: { url: 'http://localhost', browser: 'chromium' },
2828
},
2929
}
3030
```
3131

32-
Run the tests with `npx codeceptjs run`.
32+
Set `"type": "module"` in `package.json` so `tsx` compiles your `.ts` test files as ES Modules. Then run the tests with `npx codeceptjs run`.
3333

34-
> Adding TypeScript to an existing project: set `"type": "module"` in `package.json`, rename the config to `codecept.conf.ts` with `export const config = {}`, install `tsx`, and add `require: ['tsx/cjs']`.
34+
> Adding TypeScript to an existing project: set `"type": "module"` in `package.json`, rename the config to `codecept.conf.ts` with `export const config = {}`, install `tsx`, and add `require: ['tsx/esm']`.
3535
3636
## Writing tests
3737

@@ -56,7 +56,9 @@ Scenario('admin signs in', ({ I }) => {
5656
})
5757
```
5858

59-
> **Cannot find module** or **Unexpected token** while running tests means the loader isn't wired up — check that `tsx` is installed and `require: ['tsx/cjs']` is in the config.
59+
> **Cannot find module** or **Unexpected token** while running tests means the loader isn't wired up — check that `tsx` is installed and `require: ['tsx/esm']` is in the config.
60+
>
61+
> **`ERR_REQUIRE_CYCLE_MODULE`** means `tsx` is compiling your `.ts` tests as CommonJS — add `"type": "module"` to the nearest `package.json`.
6062
6163
## Promise-based typings
6264

0 commit comments

Comments
 (0)