I've got a quick demo people can download here: https://stackblitz.com/edit/angular-vczzqp Just hit export in the top right, in your favourite terminal and run install
and ng test
with your favourite browser.
Basically the issue, to me, seems to be that the internal timings of Jasmine are not matching for the objects.
Below is test as well as the exact error I get. See the example under app/Test for the full test class
it('should return a GET_GENERIC_FAILED when the services throws', () => {
const action = new genericActions.GetAllGenericAction();
genericsService.getAllGenerics.and.returnValue(Observable.throw({}));
actions$.stream = hot('a', { a: action });
const expected = cold('b', { b: new genericActions.GetGenericFailedAction() });
expect(effects.getAllGenerics).toBeObservable(expected);
});
And the error
Expected
[Object({
frame: 0,
notification: Notification({
kind: 'N',
value: GetGenericFailedAction({
type: '[GENERIC] Get Generic Failed'
}),
error: undefined,
hasValue: true
})
}), Object({
frame: 0,
notification: Notification({
kind: 'C',
value: undefined,
error: undefined,
hasValue: false
})
})]
to equal
[Object({
frame: 0,
notification: Notification({
kind: 'N',
value: GetGenericFailedAction({
type: '[GENERIC] Get Generic Failed'
}),
error: undefined,
hasValue: true
})
})].
Any guidance would be appreciated.
(b|)
part actually worked in my case. Still confused about these diagrams though. – Blindage