Skip to content

Commit 30fac65

Browse files
Merge branch 'main' into empty-rerun-file-fix
2 parents b8c2a9f + b04d6fe commit 30fac65

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

docs/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Note that the rerun file parser can only work with the default separator for now
122122

123123
## Parallel
124124

125-
You can run your scenarios in parallel with `--parallel <NUMBER_OF_WORKERS>`. Each worker is run in a separate Node process and receives the following env variables:
125+
You can run your scenarios in parallel with `--parallel <NUMBER_OF_WORKERS>`. Each worker is run in a separate Node process and receives the following env variables (as well as a copy of `process.env` from the coordinator process):
126126

127127
* `CUCUMBER_PARALLEL` - set to 'true'
128128
* `CUCUMBER_TOTAL_WORKERS` - set to the number of workers

docs/migration.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,52 @@ You'll need to update any `import`/`require` statements in your support code to
1313

1414
(The executable is still `cucumber-js` though.)
1515

16+
## Hooks
17+
18+
The result object passed as the argument to your `After` hook function has a different structure.
19+
20+
Previously in `cucumber`:
21+
22+
```js
23+
{
24+
"sourceLocation": {
25+
"uri": "features/example.feature",
26+
"line": 7
27+
},
28+
"pickle": {...},
29+
"result": {
30+
"duration": 660000000,
31+
"status": "failed",
32+
"exception": {
33+
"name": "AssertionError",
34+
"message": "...",
35+
"showDiff": false,
36+
"stack": "..."
37+
},
38+
"retried": true
39+
}
40+
}
41+
```
42+
43+
Now in `@cucumber/cucumber`:
44+
45+
```js
46+
{
47+
"gherkinDocument": {...}, // schema: https://github.com/cucumber/common/blob/main/messages/jsonschema/GherkinDocument.json
48+
"pickle": {...}, // schema: https://github.com/cucumber/common/blob/main/messages/jsonschema/Pickle.json
49+
"testCaseStartedId": "[uuid]",
50+
"result": {
51+
"status": "FAILED", // one of: UNKNOWN, PASSED, SKIPPED, PENDING, UNDEFINED, AMBIGUOUS, FAILED
52+
"message": "...", // includes stack trace
53+
"duration": {
54+
"seconds": "0",
55+
"nanos": 660000000
56+
},
57+
"willBeRetried": true
58+
}
59+
}
60+
```
61+
1662
## Formatters
1763

1864
The underlying event/data model for cucumber-js is now [cucumber-messages](https://github.com/cucumber/cucumber/tree/master/messages), a shared standard across all official Cucumber implementations. This replaces the old "event protocol".
@@ -49,4 +95,4 @@ There are a few minor differences to be aware of:
4995
- The type for data tables was named `TableDefinition` - it's now named `DataTable`
5096
- `World` was typed as an interface, but it's actually a class - you should `extend` it when [building a custom formatter](./custom_formatters.md)
5197

52-
Also, your `tsconfig.json` should have the `resolveJsonModule` compiler option switched on. Other than that, a pretty standard TypeScript setup should work as expected.
98+
Also, your `tsconfig.json` should have the `resolveJsonModule` compiler option switched on. Other than that, a pretty standard TypeScript setup should work as expected.

0 commit comments

Comments
 (0)