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


TypeScript TestHelper.descriptorResource函數代碼示例

本文整理匯總了TypeScript中test/TestHelper.descriptorResource函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript descriptorResource函數的具體用法?TypeScript descriptorResource怎麽用?TypeScript descriptorResource使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了descriptorResource函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: beforeEach

    beforeEach(() => {
      fragmentCache = new FragmentCache();

      fragmentCache.update(descriptorCollection({
        path: '/projects',
        partial: 'minimal'
      }), [dataSegmentPartial__ID_1, dataSegmentPartial__ID_2], IStatus.complete);
      fragmentCache.update(descriptorCollectionItem({
        path: '/projects/1'
      }), dataSegmentFull__ID_1, IStatus.complete);
      fragmentCache.update(descriptorCollectionItem({
        path: '/projects/2'
      }), dataSegmentFull__ID_2, IStatus.complete);

      fragmentCache.update(descriptorResource({
        path: '/resource-array'
      }), dataSegmentResource_Array, IStatus.complete);
      fragmentCache.update(descriptorResource({
        path: '/resource-object'
      }), dataSegmentResource_Object, IStatus.complete);
      fragmentCache.update(descriptorResource({
        path: '/resource-string'
      }), dataSegmentResource_String, IStatus.complete);
    });
開發者ID:netarc,項目名稱:refrax,代碼行數:24,代碼來源:fragmentCache-fetch.specp.ts

示例2: it

          it('should mark existing cache data as stale', () => {
            fragmentCache.update(descriptorResource({
              path: '/other-resource'
            }), null);

            expectedQueries['/other-resource'] = {
              timestamp: ITimestamp.stale,
              status: IStatus.complete,
              data: dataSegmentFull_Resource
            };

            expect(fragmentCache).to.have.property('fragments')
              .that.deep.equals(expectedFragments);
            expect(fragmentCache).to.have.property('queries')
              .that.deep.equals(expectedQueries);
          });
開發者ID:netarc,項目名稱:refrax,代碼行數:16,代碼來源:fragmentCache-updateReplace.specp.ts

示例3: it

            it('should add new cache data', () => {
              fragmentCache.update(descriptorResource({
                path: '/resource',
                partial: MinimalPartial
              }), dataSegmentFull_Resource);

              expectedQueries['/resource'] = {
                timestamp: mockTimestamp,
                status: IStatus.complete,
                data: dataSegmentFull_Resource
              };

              expect(fragmentCache).to.have.property('fragments')
                .that.deep.equals(expectedFragments);
              expect(fragmentCache).to.have.property('queries')
                .that.deep.equals(expectedQueries);
            });
開發者ID:netarc,項目名稱:refrax,代碼行數:17,代碼來源:fragmentCache-updateMerge.specp.ts

示例4: beforeEach

    beforeEach(() => {
      fragmentCache = new FragmentCache();

      fragmentCache.update(descriptorCollection({
        path: '/other-projects',
        partial: MinimalPartial
      }), [dataSegmentPartial__ID_3, dataSegmentPartial__ID_4], IStatus.complete);
      fragmentCache.update(descriptorCollectionItem({
        path: '/projects/3'
      }), dataSegmentFull__ID_3, IStatus.complete);
      fragmentCache.update(descriptorCollectionItem({
        path: '/projects/4'
      }), dataSegmentFull__ID_4, IStatus.complete);

      fragmentCache.update(descriptorResource({
        path: '/other-resource'
      }), dataSegmentFull_Resource, IStatus.complete);

      expectedFragments = JSON.parse(JSON.stringify(fragmentCache.fragments));
      expectedQueries = JSON.parse(JSON.stringify(fragmentCache.queries));
    });
開發者ID:netarc,項目名稱:refrax,代碼行數:21,代碼來源:fragmentCache-updateReplace.specp.ts


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