本文整理汇总了TypeScript中redux-saga-test-plan-ts.expectSaga函数的典型用法代码示例。如果您正苦于以下问题:TypeScript expectSaga函数的具体用法?TypeScript expectSaga怎么用?TypeScript expectSaga使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了expectSaga函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should add recommendations page if recommendations were returned', () => {
return expectSaga(recommendationsSaga(mockStoreApi))
.withState({
currentUser: {
status: 'LOGGED_IN',
token: '',
},
ignored: [],
owned: [],
})
.provide([
[call(mockStoreApi.getRecommendations, ''), { data: mockRecommendations }],
[call(createScrollChannel), mockScrollChannel],
[take(mockScrollChannel), mockScrollInfo299px],
[matchers.call.fn(getRecommendationsPage), mockPage],
[take(mockScrollChannel), mockScrollInfo299px],
[matchers.call.fn(getRecommendationsPage), mockPage],
])
.put(productActions.add(mockPage.products))
.put(recommendationsActions.addPage(mockPage.items))
.delay(100)
.put(productActions.add(mockPage.products))
.put(recommendationsActions.addPage(mockPage.items))
.silentRun(150)
})
示例2: it
it('should wait for authentication', () => {
return expectSaga(storeFrontSaga(mockStoreApi))
.provide([
[select(isAuthCheckFinished), false]
])
.take(authActions.authCheckFinished.getType())
.silentRun(50)
})