本文整理汇总了TypeScript中testHelpers/testHelper.expect函数的典型用法代码示例。如果您正苦于以下问题:TypeScript expect函数的具体用法?TypeScript expect怎么用?TypeScript expect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了expect函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('calls service with createStickyAction', () => {
const stub = sinon.stub().returns(Promise.resolve())
injectMock(() => sendActionToServer, () => stub as any)
dispatch(createStickyAction({x: 1, y: 2, body: 'some sticky', uuid: 'some uuid'}))
expect(stub.firstCall.args[0].payload).to.eql({x: 1, y: 2, body: 'some sticky', uuid: 'some uuid'})
expect(stub.firstCall.args[0].type).to.eql('CREATE_STICKY')
})
示例2: it
it('inserts a sticky', () => {
const state = stickiesReducers(undefined, loadStickyFromServerAction({x: 10, y: 20, body: 'i am sticky', uuid: 'foo'}))
expect(state.count()).to.eql(1)
expect(state.toArray()[0].x).to.eql(10)
expect(state.toArray()[0].y).to.eql(20)
expect(state.toArray()[0].body).to.eql('i am sticky')
})
示例3: expect
.then(() => {
expect(getState().persistenceQueue.count()).to.eql(1)
stub.returns(Promise.resolve())
dispatch(createStickyAction({x: 1, y: 2, body: 'some other sticky', uuid: 'some uuid'}))
expect(getState().persistenceQueue.count()).to.eql(2)
stub.reset()
stub.returns(Promise.resolve())
})