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


TypeScript TestHelper.descriptorFrom函數代碼示例

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


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

示例1: beforeEach

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

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

示例2: it

          it('should not modify cache', () => {
            fragmentCache.update(descriptorFrom({}));

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

示例3: it

        it('should return expected result', () => {
          const descriptor = descriptorFrom({
            path: '/resource-string'
          });
          const result = fragmentCache.fetch(descriptor);

          expectResultWithContent(result, dataSegmentResource_String);
        });
開發者ID:netarc,項目名稱:refrax,代碼行數:8,代碼來源:fragmentCache-fetch.specp.ts

示例4: it

        it('should not touch data', () => {
          fragmentCache.destroy(descriptorFrom({}));

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

示例5: it

        it('should not touch data', () => {
          fragmentCache.touch(descriptorFrom({
            path: '/projects'
          }));
          fragmentCache.touch(descriptorFrom({
            path: '/projects',
            partial: 'minimal'
          }));
          fragmentCache.touch(descriptorFrom({
            path: '/projects/1'
          }));

          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-touch.specp.ts

示例6: it

          it('should not modify cache', () => {
            fragmentCache.update(descriptorFrom({
              partial: MinimalPartial,
              cacheStrategy: IStrategy.merge,
              collectionStrategy: IStrategy.merge
            }));

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

示例7: it

      it('should properly invoke cache fetch', () => {
        const descriptor = descriptorFrom({
          basePath: '/projects'
        });

        const spyStore_fetch = spy(refStore.cache, 'fetch');

        refStore.fetchResource(descriptor);

        expect(spyStore_fetch.callCount).to.equal(1);
        expect(spyStore_fetch.getCall(0).args[0]).to.equal(descriptor);
      });
開發者ID:netarc,項目名稱:refrax,代碼行數:12,代碼來源:store.spec.ts

示例8: describe

      describe('with a descriptor argument', () => {
        const descriptor = descriptorFrom({
          basePath: '/projects'
        });

        testInvalidateResult([descriptor], [descriptor, {}]);
        testInvalidateSubscriber([descriptor], [
          {
            query: '/projects',
            action: 'invalidate'
          }
        ]);
      });
開發者ID:netarc,項目名稱:refrax,代碼行數:13,代碼來源:store.spec.ts


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