codeceptjs / codeceptjs/CodeceptJS

[feature-request] export cucumber-related types

オープン
#2,926 コメント 3 件 リアクション 3 件 担当者 1 名 @zaxovaiko が担当を希望しています GitHub で見る
enhancement good first issue typescript
主要言語
JavaScript
スター
4.2k
フォーク
757
平均マージ
2日 9時間
マージ済み PR(30日)
16

説明

#### What are you trying to achieve?

export `DataTable` and other cucumber-related types such that we can use it in step definitions

#### What do you get instead?

I need to manually define it on our own
```ts
interface OwnTableDefinition {
/**
* obtain an object that allows you to get a simple version of the table parsed by column or row
*/
parse(): {
/**
* returns the table as a 2-D array
*/
raw(): string[][],
/**
* returns the table as a 2-D array, without the first row
*/
rows(): string[][],
/**
* returns an array of objects where each row is converted to an object (column header is the key)
*/
hashes(): { [colName: string]: string }[],
};
rows: { [id: number]: { cells: { value: string }[] } };
}
```
```ts
Given('I have products in my cart', (table: OwnTableDefinition) => {
table.parse()
})
```

### Details

* CodeceptJS version: 3.0.7
* NodeJS Version: 12.20.1
* Operating System: MacOS

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。