All Questions
28 questions
1
vote
1
answer
41
views
How can I unit test a component that uses NgrxLet LetDirective?
This is my stackblitz example where you can see in the terminal the test running and its result (or you can stop the execution and run jest).
I use the NgrxLet directive to consume the resulting ...
1
vote
1
answer
46
views
Problem with getting tick from ngrx effect in marble testing JEST
I have NgRx store effect like this:
checkStatus$ = createEffect(() => {
return this.actions$.pipe(
ofType(Actions.checkstatus),
fetch({
run: ({ method }) => {
...
-1
votes
1
answer
362
views
How to create a Jest test for NgRx codes?
I'm trying to write Jest tests but some codes are so difficult like NgRx codes where we do store.dispatch actions for example. I have searched for examples or Jest documents, video tutorials, ChatGPT ...
0
votes
2
answers
1k
views
What is the correct way to provide mocked NGRX store to an Angular standalone component test?
I am trying to add a standalone component inside my existing module based NX Angular project and run into problems when trying to run the unit tests. Providing a mocked store for a non-standalone ...
0
votes
1
answer
62
views
Mock derivative Observable stream
I can not properly mock the derivative Observable stream in Jest/Angular app.
Basically I need to test NgRx effect.
export const cancel$ = createEffect(
(
actions$ = inject(Actions),
...
0
votes
1
answer
165
views
Jest create mock of property that reads from the store angular
I'm using Angular, NgRx and Jest.
I'm having the service which is reading from the store
export class MyFacade {
configuration$ = this.store.select(selectors.selectConfiguration);
}
I'm using it in ...
0
votes
1
answer
519
views
How do I unit test an Angular component with an NgRx Entity Service using Jest
I've recently upgraded to my project to use Angular 15.2.4, Jest 29.5, and NgRx 15.4.
My unit tests dealing with components containing NgRx Entity services have broken.
This is the entity Service:
...
2
votes
1
answer
1k
views
Unit testing NgRx effect as a function
I want to unit test functional effect as described here
export const loadUsers = createEffect(
(actions$ = inject(Actions), usersService = inject(UsersService)) => {
return actions$.pipe(
...
0
votes
1
answer
760
views
Dispatch Action in Unit Test that Invokes Subscribe in Component
Dispatching an Action that's subscribed to in a Component
I have an Angular 15 project and in various components I subscribe to particular events. I'm trying to dispatch a subscribed to Action in my ...
-1
votes
1
answer
419
views
Jest SpyOn not working for service in NgRx component store effect
readonly loadReviewByRouteId = this.effect(
(): Observable<EmployeeReview> =>
this.route.params.pipe(
switchMap(({id}) => this.reviewService.getReviewById(id)),
...
0
votes
0
answers
80
views
how do I write good marble tests for NGRX effects with service calls?
I have the following effect:
createListConfirm$ = createEffect(() =>
this.actions$.pipe(
ofType(listActions.createListConfirm),
withLatestFrom(this.store.select(projectSelectors....
0
votes
0
answers
215
views
BigDecimal library import not defined when Unit test is run
I am trying to test an Effects method in Angular (NGRX) using Jest. The file imports the BigDecimal library. When I run the tests I get Cannot read property 'getPrettyValue' of undefined], undefined ...
0
votes
1
answer
2k
views
Cannot find module '@ngrx/effects' when running tests with Jest
When trying to run tests with jest in our angular application I get the following message:
Cannot find module '@ngrx/effects' from 'src/app/modules/core/core.module.ts'
It is weird, because the ...
3
votes
1
answer
2k
views
[Bug]: Cannot find module '@ngrx/effects/testing' after version updates
I migrated the project from version 25 to 27 and the module '@ngrx/effects/testing' cannot more found. In my case the baseUrl in the project set to './src'.In other projects with baseUrl '.' and with ...
1
vote
1
answer
456
views
Mock catchError in NgRX createEffect call
I am currently writing a test for the following dispatch event:
@Injectable()
export class AuthEffects {
signIn$ = createEffect(() =>
this.actions$.pipe(
ofType(AuthActions.signIn),
...