-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace some uses of
any
type (#1892)
* Replace use of `any` type with `messages.Envelope` Part of #1648 Co-authored-by: Kate Dames <[email protected]> Co-authored-by: Emmanuel Ola <[email protected]> * Replace use of `any` with a custom World in CCK example Part of #1648 Co-authored-by: Emmanuel Ola <[email protected]> Co-authored-by: Blaise Pabon <[email protected]> Co-authored-by: Kate Dames <[email protected]> * Replace another use of `any` with a custom type Co-authored-by: Blaise Pabon <[email protected]> Co-authored-by: Kate Dames <[email protected]> * Replace another use of `any` type Co-authored-by: Blaise Pabon <[email protected]> Co-authored-by: Kate Dames <[email protected]> Co-authored-by: Kate Dames <[email protected]> Co-authored-by: Emmanuel Ola <[email protected]> Co-authored-by: Blaise Pabon <[email protected]>
- Loading branch information
1 parent
aa1d65c
commit c99ad50
Showing
4 changed files
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
import { When, Then, DataTable } from '../../../src' | ||
import { expect } from 'chai' | ||
|
||
type World = { | ||
transposed: DataTable | ||
} | ||
|
||
When( | ||
'the following table is transposed:', | ||
function (this: any, table: DataTable) { | ||
function (this: World, table: DataTable) { | ||
this.transposed = table.transpose() | ||
} | ||
) | ||
|
||
Then('it should be:', function (this: any, expected: DataTable) { | ||
Then('it should be:', function (this: World, expected: DataTable) { | ||
expect(this.transposed.raw()).to.deep.eq(expected.raw()) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
) |
2 changes: 1 addition & 1 deletion
2
compatibility/features/unknown-parameter-type/unknown-parameter-type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { Given } from '../../../src' | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
Given('{airport} is closed because of a strike', function (airport: any) { | ||
Given('{airport} is closed because of a strike', function (airport: unknown) { | ||
throw new Error('Should not be called because airport type not defined') | ||
}) |