本文整理汇总了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);
});