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


TypeScript power-assert.default函數代碼示例

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


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

示例1: it

 it('Var should dispose observer', function() {
   var a = new Var(1)
   var b = new Obs(function() {a.apply()})
   a.dispose(b)
   assert(a.value === 1)
   assert(a.observers.size === 0)
 })
開發者ID:HerringtonDarkholme,項目名稱:rectangular,代碼行數:7,代碼來源:ok.ts

示例2: test

 test(category + 'template with duplicated parameters', () => {
   const p = path('/users/{id}/posts/{id}');
   assert(p({}) === null);
   assert(p({ id: 'a' }) === '/users/a/posts/a');
   assert(p({ id: '' }) === '/users//posts/');
   assert(p({ id: ' ' }) === '/users/%20/posts/%20');
 }),
開發者ID:bouzuya,項目名稱:bath,代碼行數:7,代碼來源:path.ts

示例3: assert

 .then((_) => {
   assert(request.callCount === 1);
   assert(request.getCall(0).args[0].method === 'put');
   assert(request.getCall(0).args[0].path === '/atom/edit/123');
   const body = request.getCall(0).args[0].body;
   assert(body.entry.title._ === 'TITLE');
 });
開發者ID:bouzuya,項目名稱:node-hatena-fotolife-api,代碼行數:7,代碼來源:fotolife.ts

示例4: it

 it("store.key check", async(() => {
   const sc = new StoreController([new Store(null), new Store('second')]);
   const mainStore = sc.getStoreSafely();
   const secondStore = sc.getStoreSafely('second');
   assert(mainStore.key === '__main__');
   assert(secondStore.key === 'second');
 }));
開發者ID:ovrmrw,項目名稱:shuttle-store-sample,代碼行數:7,代碼來源:app.spec.ts

示例5: test

 test('compileMarkdown with options', () => {
   const markdown = 'http://example.com';
   const html = compileMarkdown(markdown, { gfm: true });
   assert(html === '<p><a href=\"http://example.com\">http://example.com</a></p>\n');
   const htmlNoGfm = compileMarkdown(markdown, { gfm: false });
   assert(htmlNoGfm === '<p>http://example.com</p>\n');
 }),
開發者ID:bouzuya,項目名稱:jekyll-markdown-parser,代碼行數:7,代碼來源:index.ts

示例6: test

 test(category + '#newToken', fixture(setUp, tearDown, ({ token1 }) => {
   const newToken = token1.newToken();
   assert(newToken.getUsername() === token1.getUsername());
   assert(newToken.getPassword() === token1.getPassword());
   assert(newToken.getCreated() !== token1.getCreated());
   assert(newToken.getNonce() !== token1.getNonce());
 })),
開發者ID:bouzuya,項目名稱:node-wsse,代碼行數:7,代碼來源:standard.ts

示例7: it

  it('exprimental', fakeAsyncPower(() => {
    let fixture: ComponentFixture<Page1Component>;
    builder.createAsync(Page1Component).then(f => fixture = f);
    tick();
    const component = fixture.componentRef.instance;
    const el = fixture.nativeElement as HTMLElement;
    const service = component.service;

    let counter: number;
    let currentTime: number;
    let previousTime: number;
    service.counter$.subscribe(value => counter = value);
    service.timeNow$.subscribe(value => {
      if (currentTime) {
        previousTime = currentTime;
      }
      currentTime = value;
    });

    service.increment(1);
    assert(counter === 1);
    service.increment(1);
    assert(counter === 2);
    service.increment(2);
    assert(counter === 4);

    fixture.detectChanges();
    console.log(elementText(el, '#now'));
    tick(1000);
    fixture.detectChanges();
    console.log(elementText(el, '#now'));
  }));
開發者ID:ovrmrw,項目名稱:angular2-testing-sample,代碼行數:32,代碼來源:page1.service.spec.ts

示例8: setTimeout

 setTimeout(() => {
   service.increment(1);
   assert(value === 1);
   service.increment(1);
   assert(value === 2);
   service.increment(2);
   assert(value === 4);
 }, 0);
開發者ID:ovrmrw,項目名稱:angular2-testing-sample,代碼行數:8,代碼來源:page1.service.spec.ts


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