本文整理汇总了TypeScript中test/TestSupport.mock_put函数的典型用法代码示例。如果您正苦于以下问题:TypeScript mock_put函数的具体用法?TypeScript mock_put怎么用?TypeScript mock_put使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mock_put函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should correctly update entries', () => {
mock_put('/rules', dataRules);
return invokeTestHelper(IActionType.update, schema.rules.__stack, {
payload: dataRules,
expectedSignal: dataRules
});
});
示例2: beforeEach
beforeEach(() => {
mutableUsers = new MutableResource(schema.users);
store = expectedDescriptor.store = schema.__node.definition.storeMap.getOrCreate('user');
spyMutableUsers_generateDescriptor = spy(mutableUsers, '_generateDescriptor');
spyStore_touchResource = spy(store, 'touchResource');
spyStore_updateResource = spy(store, 'updateResource');
spyStore_destroyResource = spy(store, 'destroyResource');
mock_reset();
mock_put('/users', responseData);
});
示例3: expect
.then(() => {
expect(resourceUsers).to.deep.match({
data: dataCollectionUsers1,
status: IStatus.complete,
timestamp: (val: number) => val > ITimestamp.loading
});
mock_put('/users/1', { id: 1, name: 'bob foo' });
const promiseUpdate = mutableUser.update({ name: 'bob foo' });
// The `touch` event from our `update` does not affect the collection
expect(resourceUsers).to.deep.match({
data: dataCollectionUsers1,
status: IStatus.complete,
timestamp: (val: number) => val > ITimestamp.loading
});
return promiseUpdate;
})