fix: view engine - fix some corner cases

This commit is contained in:
Tobias Bosch
2017-02-20 14:34:15 -08:00
committed by Igor Minar
parent 32012a1ffb
commit 7db93310f1
9 changed files with 93 additions and 29 deletions

View File

@ -7,14 +7,14 @@
*/
import {PlatformLocation} from '@angular/common';
import {USE_VIEW_ENGINE} from '@angular/compiler/src/config';
import {ApplicationRef, CompilerFactory, Component, NgModule, NgModuleRef, NgZone, PlatformRef, destroyPlatform, getPlatform} from '@angular/core';
import {async, inject} from '@angular/core/testing';
import {TestBed, async, inject} from '@angular/core/testing';
import {Http, HttpModule, Response, ResponseOptions, XHRBackend} from '@angular/http';
import {MockBackend, MockConnection} from '@angular/http/testing';
import {DOCUMENT} from '@angular/platform-browser';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {INITIAL_CONFIG, PlatformState, ServerModule, platformDynamicServer, renderModule, renderModuleFactory} from '@angular/platform-server';
import {Subscription} from 'rxjs/Subscription';
import {filter} from 'rxjs/operator/filter';
import {first} from 'rxjs/operator/first';
@ -99,6 +99,25 @@ class ImageExampleModule {
}
export function main() {
describe('regular', () => { declareTests({viewEngine: false}); });
describe('view engine', () => {
beforeEach(() => {
TestBed.configureCompiler({
useJit: true,
providers: [{
provide: USE_VIEW_ENGINE,
useValue: true,
}],
});
});
declareTests({viewEngine: true});
});
}
function declareTests({viewEngine}: {viewEngine: boolean}) {
if (getDOM().supportsDOMEvents()) return; // NODE only
describe('platform-server integration', () => {