当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript test-helpers.visit函数代码示例

本文整理汇总了TypeScript中@ember/test-helpers.visit函数的典型用法代码示例。如果您正苦于以下问题:TypeScript visit函数的具体用法?TypeScript visit怎么用?TypeScript visit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了visit函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: visit

export async function visit(url: string) {
  try {
    await dangerousVisit(url);
  } catch (e) {
    // console.error('visit wrapper around default visit helper', e);
  }
}
开发者ID:NullVoxPopuli,项目名称:emberclear,代码行数:7,代码来源:index.ts

示例2: function

    hooks.beforeEach(async function() {
      window.Notification = {
        permission: undefined,
      };

      await visit('/chat/privately-with/me');
    });
开发者ID:NullVoxPopuli,项目名称:emberclear,代码行数:7,代码来源:-acceptance-test.ts

示例3: function

    hooks.beforeEach(async function() {
      const store = getService<StoreService>('store');

      await store.createRecord('relay', defaultRelays[0]).save();
      await store.createRecord('relay', defaultRelays[1]).save();
      await store.createRecord('relay', defaultRelays[2]).save();
      await visit(path);
    });
开发者ID:NullVoxPopuli,项目名称:emberclear,代码行数:8,代码来源:-acceptance-test.ts

示例4: test

  test('Search does not through an error when typing', async function(assert) {
    await appLogin();
    await visit('/');

    assert.equal(currentURL(), '/browse/datasets', 'We made it to the home page in one piece');
    fillIn(searchBarSelector, 'Hello darkness my old friend');
    assert.ok(true, 'Did not encounter an error when filling in search bar');
  });
开发者ID:alyiwang,项目名称:WhereHows,代码行数:8,代码来源:search-test.ts

示例5: function

    hooks.beforeEach(async function() {
      await visit('/');
      window.Notification = {
        permission: undefined,
      };

      notifications = getService<Notifications>('notifications');
    });
开发者ID:NullVoxPopuli,项目名称:emberclear,代码行数:8,代码来源:acceptance-test.ts

示例6: function

      hooks.beforeEach(async function() {
        me = getService<CurrentUserService>('currentUser').record!;

        await createContact('First Contact');
        await createContact('Second Contact');

        await visit('/contacts');
      });
开发者ID:NullVoxPopuli,项目名称:emberclear,代码行数:8,代码来源:acceptance-test.ts

示例7: visit

  @test async 'visiting /'(assert: Assert) {
    await visit('/');
    assert.equal(currentURL(), '/');

    const codeElement: Element | null = find('.index-view code');
    if (codeElement === null) { throw new Error('no <code>'); }
    assert.ok(/min\-width:\s[0-9]+px/.test('' + codeElement.textContent), 'min-width text found');
  }
开发者ID:mike-north,项目名称:ember-resize,代码行数:8,代码来源:index-test.ts

示例8: function

    hooks.beforeEach(async function() {
      stubService('currentUser', {
        isLoggedIn: false,
        load() {},
        exists: () => false,
      });

      await visit('/logout');
    });
开发者ID:NullVoxPopuli,项目名称:emberclear,代码行数:9,代码来源:logout-test.ts

示例9: test

  test('Search tracks correctly', async function(assert) {
    const searchTerm = 'somerandomsearch';
    const SEARCH_EVENT_NAME = 'trackSiteSearch';

    await appLogin();
    await visit(`/search?keyword=${searchTerm}`);

    const [, keyword] = getTrackingEvent(SEARCH_EVENT_NAME);

    assert.equal(keyword, searchTerm, 'Search should be tracked correctly');
  });
开发者ID:alyiwang,项目名称:WhereHows,代码行数:11,代码来源:tracking-test.ts

示例10: test

  test('it automatically finds keys when attached to container-managed objects', async function(assert) {
    await visit('/');

    const appRoute = this.owner.lookup('route:application');
    appRoute.debug('test message from the application route');

    let [routeMessage] = log.lastCall.args;
    assert.ok(/route:application/.test(routeMessage), 'Route message should include its container key');

    const testService = this.owner.lookup('service:my/test/module');
    testService.debug('test message from the mysterious service');

    let [serviceMessage] = log.lastCall.args;
    assert.ok(/service:my\/test\/module/.test(serviceMessage), 'Service message should include its container key');
  });
开发者ID:salsify,项目名称:ember-debug-logger,代码行数:15,代码来源:container-keys-test.ts


注:本文中的@ember/test-helpers.visit函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。