question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

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:open
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Splaktarcommented, Feb 24, 2021

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 native Promise.

0reactions
angular-robot[bot]commented, Mar 30, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found