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


TypeScript testing.platformServerTesting函數代碼示例

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


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

示例1: task

task('test:ssr', [':test:build'], (done: () => void) => {
  const baseUrl = join(projectDir, 'dist', 'packages', 'flex-layout');
  const paths = {
    '@angular/flex-layout/*': ['./*']
  };
  register({baseUrl, paths});
  const jasmine = new (require('jasmine'))({projectBaseDir: projectDir});
  require('zone.js');
  require('zone.js/dist/zone-testing');
  const {TestBed} = require('@angular/core/testing');
  const {ServerTestingModule, platformServerTesting} = require('@angular/platform-server/testing');
  let testBed = TestBed.initTestEnvironment(
    ServerTestingModule,
    platformServerTesting()
  );

  patchTestBed(testBed);
  jasmine.loadConfigFile('test/jasmine-ssr.json');
  jasmine.execute();
  done();
});
開發者ID:marffox,項目名稱:flex-layout,代碼行數:21,代碼來源:unit-test-ssr.ts

示例2: platformServerTesting

import 'reflect-metadata';
import {platformServerTesting, ServerTestingModule} from '@angular/platform-server/testing';
import { TestBed } from '@angular/core/testing';

TestBed.initTestEnvironment(ServerTestingModule, platformServerTesting());
開發者ID:ubiquits,項目名稱:quickstart,代碼行數:5,代碼來源:bootstrap.spec.ts

示例3: beforeEach

beforeEach((done) => {
  platformServerTesting().bootstrapModuleFactory(MainModuleNgFactory).then((moduleRef: any) => {
    mainModuleRef = moduleRef;
    done();
  });
});
開發者ID:AnthonyPAlicea,項目名稱:angular,代碼行數:6,代碼來源:util.ts

示例4: beforeEach

 beforeEach(() => {
   TestBed.initTestEnvironment(ServerTestingModule, platformServerTesting(), SomeModuleNgSummary);
 });
開發者ID:AnthonyPAlicea,項目名稱:angular,代碼行數:3,代碼來源:jit_summaries_spec.ts


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