Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hook types and test run ids #2463

Merged
merged 6 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
Please see [CONTRIBUTING.md](./CONTRIBUTING.md) on how to contribute to Cucumber.

## [Unreleased]
### Added
- `junit` formatter now includes `timestamp` attribute ([junit-xml-formatter#45](https://github.com/cucumber/junit-xml-formatter/pull/45))
- `Hook` message now includes `type` ([#2463](https://github.com/cucumber/cucumber-js/pull/2463))
- `TestRunStarted` message now includes `id`; `TestCase` and `TestRunFinished` messages reference it in `testRunStartedId` ([#2463](https://github.com/cucumber/cucumber-js/pull/2463))

## [11.1.1] - 2024-12-11
### Fixed
Expand Down
8 changes: 5 additions & 3 deletions compatibility/features/attachments/attachments.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import fs from 'node:fs'
import path from 'node:path'
import { Before, When } from '../../../src'

Before(() => undefined)
import { When } from '../../../src'

When(
'the string {string} is attached as {string}',
Expand Down Expand Up @@ -90,3 +88,7 @@ When('a PDF document is attached and renamed', async function () {
}
)
})

When('a link to {string} is attached', async function (uri: string) {
this.link(uri)
})
31 changes: 15 additions & 16 deletions compatibility/features/examples-tables/examples-tables.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import assert from 'node:assert'
import { Given, When, Then } from '../../../src'

type World = {
count: number
}
Given('there are {int} cucumbers', function (initialCount: number) {
this.count = initialCount
})

Given(
'there are {int} cucumbers',
function (this: World, initialCount: number) {
this.count = initialCount
}
)
Given('there are {int} friends', function (initialFriends: number) {
this.friends = initialFriends
})

When('I eat {int} cucumbers', function (this: World, eatCount: number) {
When('I eat {int} cucumbers', function (eatCount: number) {
this.count -= eatCount
})

Then(
'I should have {int} cucumbers',
function (this: World, expectedCount: number) {
assert.strictEqual(this.count, expectedCount)
}
)
Then('I should have {int} cucumbers', function (expectedCount: number) {
assert.strictEqual(this.count, expectedCount)
})

Then('each person can eat {int} cucumbers', function (expectedShare) {
const share = Math.floor(this.count / (1 + this.friends))
assert.strictEqual(share, expectedShare)
})
1 change: 1 addition & 0 deletions features/support/formatter_output_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export const ignorableKeys = [
'pickleId',
'pickleStepId',
'stepDefinitionIds',
'testRunStartedId',
'testCaseId',
'testCaseStartedId',
'testStepId',
Expand Down
Loading
Loading