本文整理匯總了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();
});
示例2: platformServerTesting
import 'reflect-metadata';
import {platformServerTesting, ServerTestingModule} from '@angular/platform-server/testing';
import { TestBed } from '@angular/core/testing';
TestBed.initTestEnvironment(ServerTestingModule, platformServerTesting());
示例3: beforeEach
beforeEach((done) => {
platformServerTesting().bootstrapModuleFactory(MainModuleNgFactory).then((moduleRef: any) => {
mainModuleRef = moduleRef;
done();
});
});
示例4: beforeEach
beforeEach(() => {
TestBed.initTestEnvironment(ServerTestingModule, platformServerTesting(), SomeModuleNgSummary);
});