當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。