feat(cdk/testing): Consider adding a `TestElementPromise` class
See original GitHub issueFeature 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.
await harness.host().getText();
Instead of:
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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
feat(@angular/cdk/testing): Component Harness Feedback
This is an open discussion aiming to regroup Component Harness feedback and improvement ideas. Most of the items below are focused on ...
Read more >Testing constructs - AWS Cloud Development Kit (AWS CDK) v2
Open src\StateMachine. sln in Visual Studio. Right-click the solution in Solution Explorer and choose Add > New Project. Search for MSTest C# and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
While polyfills are certainly used in some test configurations, especially when i18n is involved, it’s unlikely that there would be any need to polyfill
Promise
now that Angular only supports IE11 and other browsers that support nativePromise
.Thank you for submitting your feature request! Looks like during the polling process it didn’t collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular’s scope, we’d encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.