You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then I've written some tests like this (I'm using spectator but I guess/hope that's not the issue)
it('should call delete on blobStore with id',()=>{constblobStore=spectator.inject(BLOB_STORE);actions$=of(Actions.delete({id: 'first id'}));constsub=spectator.service.delete.subscribe();expect(blobStore.delete).toHaveBeenCalledWith('first id');});it('should call delete on blobStore for every action',()=>{constblobStore=spectator.inject(BLOB_STORE);actions$=of(Actions.delete({id: 'second id'}),Actions.delete({id: 'third id'}),);spectator.service.delete.subscribe();expect(blobStore.delete).toHaveBeenCalledWith('second id','third id');});
The setup with actions$ is done as described in the documentation.
The issue is, that the toHaveBeenCalledWith shows me that it is called 3 times and the first time is with the id from the test before.
I have configured my service to be destroyed after each test. But somehow that doesn't help. I'm quite confused how this is possible.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a simple effect
Then I've written some tests like this (I'm using spectator but I guess/hope that's not the issue)
The setup with
actions$
is done as described in the documentation.The issue is, that the toHaveBeenCalledWith shows me that it is called 3 times and the first time is with the id from the test before.
I have configured my service to be destroyed after each test. But somehow that doesn't help. I'm quite confused how this is possible.
Beta Was this translation helpful? Give feedback.
All reactions