是否有任何理由将可观察到的动作定义为可热观察? 当我将可观察到的热点更改为寒冷时,测试仍然成功。
it('should return a CreateProjectSuccess action, on success', () => {
const project = createProjectDto(
'abc',
'description',
[1, 2, 3],
['1', '2', '3']
);
const resultProjectReference = { reference: 'my-project-abc' };
const action = new ProjectActions.CreateProject(project);
const outcome = new ProjectActions.CreateProjectSuccess(
resultProjectReference
);
// Why should this be a hot observable?
actions$ = hot('-a', { a: action });
const response = cold('-a|', { a: resultProjectReference });
const expected = cold('--b', { b: outcome });
projectService.createProject.and.returnValue(response);
expect(effects.createProject$).toBeObservable(expected);
});