Skip to content

docs(testing): expose how to define the type of an signal store insta… #4745

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,10 @@ it('should show movies (spy)', () => {

This version requires the `MoviesStore` state to be unprotected.

### Getting the type of the Store to be mocked.

Some mocking tools and libraries like ts-mockito or ng-mockito need that you provide the type of the object to be mocked. In that case, you can provide `InstanceType<typeof YourStore>>` as the type.

## Integration Tests

Services attached to a component are often simple, and writing unit tests for them may not always be necessary, particularly when considering the returned value and maintenance costs. In such cases, it is more effective to test the services together with the component as a whole. This type of testing is commonly referred to as integration testing.
Expand Down