angular / angular/components

feat(cdk/testing): Consider adding a `TestElementPromise` class

オープン
#21,183 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
area: cdk/testing feature P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

#### Feature Description

@yjaaidi proposed this idea in https://github.com/angular/components/issues/20871. We could create a subclass of `Promise` that would allow calling `TestElement` methods directly on the Promise. Example: https://stackblitz.com/edit/test-element-promise

#### Use Case

This would allow people to write cleaner test code, e.g.

```ts
await harness.host().getText();
```

Instead of:

```ts
await (await harness.host()).getText();
// or
await harness.host().then(host => host.getText());
```

The idea would need a design doc and discussion with the team before proceeding.

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

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

調査の方向性

まず TestElement と harness の API を確認し、次にリンクされた提案を TestElementPromise の例と比較します。Promise サブクラスと TestElement メソッドの直接呼び出しを扱う設計ドキュメントを作成し、チームでの議論を通じて、この機能を進めるべきかどうかを判断します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
testing
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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