当前位置: 首页>>代码示例>>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;未经允许,请勿转载。