Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please export testingEffect, flushEffects, resetEffects in @angular/core/testing #51429

Closed
e-oz opened this issue Aug 20, 2023 · 3 comments
Closed
Labels
area: core Issues related to the framework runtime cross-cutting: signals
Milestone

Comments

@e-oz
Copy link

e-oz commented Aug 20, 2023

Which @angular/* package(s) are relevant/related to the feature request?

core

Description

Please consider exporting utility functions for testing effect().
They internally import Watch, and I doubt you are going to export Watch, but the functions themselves are quite handy.

Proposed solution

Part of public API of @angular/core/testing

Alternatives considered

Copy-pasting Watch just to recreate these functions, but it's an awful idea.

@AndrewKushnir AndrewKushnir added the area: core Issues related to the framework runtime label Aug 21, 2023
@ngbot ngbot bot added this to the needsTriage milestone Aug 21, 2023
@pkozlowski-opensource
Copy link
Member

We've just landed #51049 that introduces the flushEffects() method on TestBed. In our view it should be enough to tests effects under TestBed - please give it a try and let us know how testing goes!

In the future we think of introducing a first-class effect scheduler interface with a specific implementation for tests. This would allow even easier testing, outside of TestBed.

@e-oz
Copy link
Author

e-oz commented Sep 13, 2023

Thank you so much!

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime cross-cutting: signals
Projects
None yet
Development

No branches or pull requests

3 participants