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