當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript TestSupport.mock_put函數代碼示例

本文整理匯總了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
            });
          });
開發者ID:netarc,項目名稱:refrax,代碼行數:8,代碼來源:XHRAdapter.spec.ts

示例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);
      });
開發者ID:netarc,項目名稱:refrax,代碼行數:12,代碼來源:mutableResource.spec.ts

示例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;
          })
開發者ID:netarc,項目名稱:refrax,代碼行數:19,代碼來源:mutableResource.spec.ts


注:本文中的test/TestSupport.mock_put函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。