-
-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(signals): add unprotected testing helper #4725
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
Conversation
✅ Deploy Preview for ngrx-io ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
I went through the discussion on the issue and just wanted to share a thought. I feel there’s a bit of a risk that unprotected might be used in unintended ways in application code — something we might be able to reduce by adjusting the design so that unprotected is only accessible via a TestBed context. There are two areas that could lead to accidental usage:
One idea might be to use something like TestBed.configureTestingModule({ provideNgRxTesting() });
const { unprotected } = TestBed.inject(NgRxTesting);I know this could still be misused, but the design would more clearly indicate that it’s intended for testing. |
timdeschryver
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 💪
|
Sorry @rainerhahnekamp , I missed your comment. I get your point, on the other hand, I like the simplicity of the I hope teams will review their code to catch these misuses, and/or create a rule that |
|
Its added to the official Docs (19.0.1). Tried to use it but ofc getting an error 😅 https://ngrx.io/guide/signals/signal-store/testing#unprotected just noticed because it ofc doesn't find the package |
|
Just read the docs and wondered why it is not working for me 😃 Any plans about when the next release including this will happen? |
|
The new minor release will be published in the next 1-2 weeks. We're waiting for a few more features to land. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #4540
What is the new behavior?
The new
testingplugin is added withunprotectedhelper:Does this PR introduce a breaking change?