我使用rxjs 6和redux可观察1,并为epic编写测试。action$ => .ofType(authActions.signIn) switchMap(mapSignInAction$)我使用TestScheduler进行大理石图测试,在运行测试时返回错误action$.ofType is not a function。测试:
import {
在测试用例之后,将正确返回数据,但JEST显示失败。该测试是使用TestScheduler编写的 expect(received).toEqual(expected) // deep equality
import { mergeMap, map, tap } from 'rxjs/operators';
import { of, from } from &
如果我同时运行一个史诗的所有测试,那么只有第一个测试通过。其他测试失败是因为框架不同。但每一次单程测试都通过了。我找不到与此相关的任何问题,在RxJS中发现了一些东西,而不是可观察到的redux文档。我以为在TestScheduler上可能会有某种重置功能,但是没有。我的一个测试(它们看起来都很像):
test('should fail if e-mail is missing'
我有一个棱角分明的服务,可以观察到我正在尝试用rxjs TestScheduler测试大理石。服务上的一种方法控制可观察到的发射值,使用BehaviorSubject作为源。_isVisibleSubject.value);}
expectObservable(service.isVisible$).toBe(expected, value