Skip to content

Commit

Permalink
Replace use of any with a custom World in CCK example
Browse files Browse the repository at this point in the history
Part of #1648

Co-authored-by: Emmanuel Ola <[email protected]>
Co-authored-by: Blaise Pabon <[email protected]>
Co-authored-by: Kate Dames <[email protected]>
  • Loading branch information
4 people committed Jan 14, 2022
1 parent 6b6e598 commit 49cb133
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions compatibility/features/examples-tables/examples-tables.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
import assert from 'assert'
import { Given, When, Then } from '../../../src'

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

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

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

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

0 comments on commit 49cb133

Please sign in to comment.