build(core): remove `main()` from specs (#21053)
`main()` function used to be needed to support dart, since dart Does not allow top level statements. Since we no longer use dart The need for `main()` has been removed. In preparation for `Basel` and standardized way of running tests we are removing `main()` PR Close #21053
This commit is contained in:
parent
86a36eaadd
commit
f3fc74ab67
|
@ -18,7 +18,7 @@ import {TestBed, fakeAsync, flushMicrotasks} from '../../testing';
|
|||
const DEFAULT_NAMESPACE_ID = 'id';
|
||||
const DEFAULT_COMPONENT_ID = '1';
|
||||
|
||||
export function main() {
|
||||
(function() {
|
||||
// these tests are only mean't to be run within the DOM (for now)
|
||||
if (typeof Element == 'undefined') return;
|
||||
|
||||
|
@ -3428,7 +3428,7 @@ export function main() {
|
|||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function assertHasParent(element: any, yes: boolean) {
|
||||
const parent = getDOM().parentElement(element);
|
||||
|
|
|
@ -19,7 +19,7 @@ import {TestBed} from '../../testing';
|
|||
import {fakeAsync, flushMicrotasks} from '../../testing/src/fake_async';
|
||||
|
||||
|
||||
export function main() {
|
||||
(function() {
|
||||
// these tests are only mean't to be run within the DOM (for now)
|
||||
if (typeof Element == 'undefined') return;
|
||||
|
||||
|
@ -3300,7 +3300,7 @@ export function main() {
|
|||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
function cancelAllPlayers(players: AnimationPlayer[]) {
|
||||
players.forEach(p => p.destroy());
|
||||
|
|
|
@ -14,7 +14,7 @@ import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
|||
import {ActivatedRoute, Router, RouterOutlet} from '@angular/router';
|
||||
import {RouterTestingModule} from '@angular/router/testing';
|
||||
|
||||
export function main() {
|
||||
(function() {
|
||||
// these tests are only mean't to be run within the DOM (for now)
|
||||
if (typeof Element == 'undefined') return;
|
||||
|
||||
|
@ -519,7 +519,7 @@ export function main() {
|
|||
expect(p2.element.getAttribute('data-depth')).toEqual('1');
|
||||
}));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function makeAnimationData(value: string, params: {[key: string]: any} = {}): {[key: string]: any} {
|
||||
return {'animation': {value, params}};
|
||||
|
|
|
@ -15,7 +15,7 @@ import {browserDetection} from '@angular/platform-browser/testing/src/browser_ut
|
|||
|
||||
import {TestBed} from '../../testing';
|
||||
|
||||
export function main() {
|
||||
(function() {
|
||||
// these tests are only mean't to be run within the DOM (for now)
|
||||
// Buggy in Chromium 39, see https://github.com/angular/angular/issues/15793
|
||||
if (typeof Element == 'undefined' || !ɵsupportsWebAnimations()) return;
|
||||
|
@ -452,7 +452,7 @@ export function main() {
|
|||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
function approximate(value: number, target: number) {
|
||||
return Math.abs(target - value) / value;
|
||||
|
|
|
@ -9,7 +9,7 @@ import {Injector} from '@angular/core';
|
|||
import {APP_INITIALIZER, ApplicationInitStatus} from '../src/application_init';
|
||||
import {TestBed, async, inject} from '../testing';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('ApplicationInitStatus', () => {
|
||||
describe('no initializers', () => {
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import {LOCALE_ID} from '@angular/core';
|
||||
import {describe, expect, inject, it} from '../testing/src/testing_internal';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Application module', () => {
|
||||
it('should set the default locale to "en-US"',
|
||||
inject([LOCALE_ID], (defaultLocale: string) => { expect(defaultLocale).toEqual('en-US'); }));
|
||||
|
|
|
@ -15,7 +15,6 @@ import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
|||
import {DOCUMENT} from '@angular/platform-browser/src/dom/dom_tokens';
|
||||
import {dispatchEvent} from '@angular/platform-browser/testing/src/browser_util';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {ServerModule} from '@angular/platform-server';
|
||||
import {NoopNgZone} from '../src/zone/ng_zone';
|
||||
import {ComponentFixtureNoNgZone, TestBed, async, inject, withModule} from '../testing';
|
||||
|
||||
|
@ -23,7 +22,7 @@ import {ComponentFixtureNoNgZone, TestBed, async, inject, withModule} from '../t
|
|||
class SomeComponent {
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('bootstrap', () => {
|
||||
let mockConsole: MockConsole;
|
||||
|
||||
|
@ -54,7 +53,9 @@ export function main() {
|
|||
const errorHandler = new ErrorHandler();
|
||||
(errorHandler as any)._console = mockConsole as any;
|
||||
|
||||
const platformModule = getDOM().supportsDOMEvents() ? BrowserModule : ServerModule;
|
||||
const platformModule = getDOM().supportsDOMEvents() ?
|
||||
BrowserModule :
|
||||
require('@angular/platform-server').ServerModule;
|
||||
|
||||
@NgModule({
|
||||
providers: [{provide: ErrorHandler, useValue: errorHandler}, options.providers || []],
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {devModeEqual} from '@angular/core/src/change_detection/change_detection_util';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('ChangeDetectionUtil', () => {
|
||||
describe('devModeEqual', () => {
|
||||
it('should do the deep comparison of iterables', () => {
|
||||
|
|
|
@ -24,7 +24,7 @@ class ComplexItem {
|
|||
}
|
||||
|
||||
// todo(vicb): UnmodifiableListView / frozen object when implemented
|
||||
export function main() {
|
||||
{
|
||||
describe('iterable differ', function() {
|
||||
describe('DefaultIterableDiffer', function() {
|
||||
let differ: DefaultIterableDiffer<any>;
|
||||
|
|
|
@ -12,7 +12,7 @@ import {kvChangesAsString, testChangesAsString} from '../../change_detection/uti
|
|||
|
||||
|
||||
// todo(vicb): Update the code & tests for object equality
|
||||
export function main() {
|
||||
{
|
||||
describe('keyvalue differ', function() {
|
||||
describe('DefaultKeyValueDiffer', function() {
|
||||
let differ: DefaultKeyValueDiffer<any, any>;
|
||||
|
|
|
@ -11,7 +11,7 @@ import {IterableDiffers} from '@angular/core/src/change_detection/differs/iterab
|
|||
|
||||
import {SpyIterableDifferFactory} from '../../spies';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('IterableDiffers', function() {
|
||||
let factory1: any;
|
||||
let factory2: any;
|
||||
|
|
|
@ -82,7 +82,7 @@ class NestedAsyncTimeoutComp {
|
|||
}
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('ComponentFixture', () => {
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
|
|
|
@ -164,7 +164,7 @@ class TestApp {
|
|||
isClosed = true;
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('debug element', () => {
|
||||
let fixture: ComponentFixture<any>;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {isDevMode} from '@angular/core';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('dev mode', () => {
|
||||
it('is enabled in our tests by default', () => { expect(isDevMode()).toBe(true); });
|
||||
});
|
||||
|
|
|
@ -10,7 +10,7 @@ import {Type} from '@angular/core';
|
|||
import {forwardRef, resolveForwardRef} from '@angular/core/src/di';
|
||||
import {describe, expect, it} from '@angular/core/testing/src/testing_internal';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('forwardRef', function() {
|
||||
it('should wrap and unwrap the reference', () => {
|
||||
const ref = forwardRef(() => String);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
import {Injector} from '@angular/core';
|
||||
import {describe, expect, it} from '@angular/core/testing/src/testing_internal';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Injector.NULL', () => {
|
||||
it('should throw if no arg is given', () => {
|
||||
expect(() => Injector.NULL.get('someToken'))
|
||||
|
|
|
@ -66,9 +66,9 @@ class NoAnnotations {
|
|||
constructor(secretDependency: any) {}
|
||||
}
|
||||
|
||||
function factoryFn(a: any) {}
|
||||
function factoryFn(a: any){}
|
||||
|
||||
export function main() {
|
||||
(function() {
|
||||
const dynamicProviders = [
|
||||
{provide: 'provider0', useValue: 1}, {provide: 'provider1', useValue: 1},
|
||||
{provide: 'provider2', useValue: 1}, {provide: 'provider3', useValue: 1},
|
||||
|
@ -526,4 +526,4 @@ export function main() {
|
|||
.toEqual('ReflectiveInjector(providers: [ "Engine" , "BrokenEngine" ])');
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {KeyRegistry} from '@angular/core/src/di/reflective_key';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('key', function() {
|
||||
let registry: KeyRegistry;
|
||||
|
||||
|
|
|
@ -75,9 +75,9 @@ class NoAnnotations {
|
|||
constructor(secretDependency: any) {}
|
||||
}
|
||||
|
||||
function factoryFn(a: any) {}
|
||||
function factoryFn(a: any){}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
const dynamicProviders = [
|
||||
{provide: 'provider0', useValue: 1}, {provide: 'provider1', useValue: 1},
|
||||
{provide: 'provider2', useValue: 1}, {provide: 'provider3', useValue: 1},
|
||||
|
|
|
@ -11,7 +11,7 @@ import {Component, Directive} from '@angular/core/src/metadata';
|
|||
import {TestBed, inject} from '@angular/core/testing';
|
||||
import {Log} from '@angular/core/testing/src/testing_internal';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('directive lifecycle integration spec', () => {
|
||||
let log: Log;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import {beforeEach, describe, expect, it} from '@angular/core/testing/src/testin
|
|||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {el, stringifyElement} from '@angular/platform-browser/testing/src/browser_util';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('dom adapter', () => {
|
||||
let defaultDoc: any;
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {describe, expect, it} from '@angular/core/testing/src/testing_internal';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Shim', () => {
|
||||
|
||||
it('should provide correct function.name ', () => {
|
||||
|
|
|
@ -15,7 +15,7 @@ class MockConsole {
|
|||
error(...s: any[]): void { this.res.push(s); }
|
||||
}
|
||||
|
||||
export function main() {
|
||||
(function() {
|
||||
function errorToString(error: any) {
|
||||
const logger = new MockConsole();
|
||||
const errorHandler = new ErrorHandler();
|
||||
|
@ -72,7 +72,7 @@ ERROR CONTEXT#Context`);
|
|||
expect(logger).toHaveBeenCalledWith(console, 'ERROR', err);
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
function debugError(originalError: any, context: any): Error {
|
||||
const error = wrappedError(`Error in ${context.source}`, originalError);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import {AsyncTestCompleter, beforeEach, describe, expect, inject, it} from '@angular/core/testing/src/testing_internal';
|
||||
import {EventEmitter} from '../src/event_emitter';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('EventEmitter', () => {
|
||||
let emitter: EventEmitter<any>;
|
||||
|
||||
|
|
|
@ -12,10 +12,11 @@ import {expect} from '@angular/platform-browser/testing/src/matchers';
|
|||
|
||||
import {Parser} from '../../compiler/src/expression_parser/parser';
|
||||
|
||||
|
||||
const resolvedPromise = Promise.resolve(null);
|
||||
const ProxyZoneSpec: {assertPresent: () => void} = (Zone as any)['ProxyZoneSpec'];
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('fake async', () => {
|
||||
it('should run synchronous code', () => {
|
||||
let ran = false;
|
||||
|
|
|
@ -11,7 +11,7 @@ import {Component, ContentChildren, Directive, Inject, NO_ERRORS_SCHEMA, NgModul
|
|||
import {TestBed} from '@angular/core/testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('forwardRef integration', function() {
|
||||
beforeEach(() => { TestBed.configureTestingModule({imports: [Module], declarations: [App]}); });
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
|||
];
|
||||
|
||||
|
||||
export function main() {
|
||||
(function() {
|
||||
let elSchema: MockSchemaRegistry;
|
||||
let renderLog: RenderLog;
|
||||
let directiveLog: DirectiveLog;
|
||||
|
@ -1608,7 +1608,7 @@ export function main() {
|
|||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
@Injectable()
|
||||
class RenderLog {
|
||||
|
|
|
@ -13,7 +13,7 @@ import {TestBed} from '@angular/core/testing';
|
|||
import {Console} from '../../src/console';
|
||||
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('jit', () => { declareTests({useJit: true}); });
|
||||
describe('no jit', () => { declareTests({useJit: false}); });
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import {stringify} from '../../src/util';
|
|||
|
||||
const ANCHOR_ELEMENT = new InjectionToken('AnchorElement');
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('jit', () => { declareTests({useJit: true}); });
|
||||
|
||||
describe('no jit', () => { declareTests({useJit: false}); });
|
||||
|
|
|
@ -13,7 +13,7 @@ import {Component, Directive, Injectable, NgModule, Pipe, Type} from '@angular/c
|
|||
import {TestBed, async, getTestBed} from '@angular/core/testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Jit Summaries', () => {
|
||||
let instances: Map<any, Base>;
|
||||
let summaries: () => any[];
|
||||
|
|
|
@ -12,7 +12,7 @@ import {TestBed} from '@angular/core/testing';
|
|||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('jit', () => { declareTests({useJit: true}); });
|
||||
describe('no jit', () => { declareTests({useJit: false}); });
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ class DummyConsole implements Console {
|
|||
warn(message: string) { this.warnings.push(message); }
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('jit', () => { declareTests({useJit: true}); });
|
||||
|
||||
describe('no jit', () => { declareTests({useJit: false}); });
|
||||
|
|
|
@ -12,7 +12,7 @@ import {By} from '@angular/platform-browser/src/dom/debug/by';
|
|||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('projection', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({declarations: [MainComp, OtherComp, Simple]}));
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import {Subject} from 'rxjs/Subject';
|
|||
|
||||
import {stringify} from '../../src/util';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Query API', () => {
|
||||
|
||||
beforeEach(() => TestBed.configureTestingModule({
|
||||
|
|
|
@ -12,7 +12,7 @@ import {fakeAsync, tick} from '@angular/core/testing';
|
|||
import {beforeEach, describe, expect, it} from '@angular/core/testing/src/testing_internal';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('QueryList', () => {
|
||||
let queryList: QueryList<string>;
|
||||
let log: string;
|
||||
|
|
|
@ -13,7 +13,7 @@ import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
|||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('jit', () => { declareTests({useJit: true}); });
|
||||
|
||||
describe('no jit', () => { declareTests({useJit: false}); });
|
||||
|
|
|
@ -11,7 +11,7 @@ import {ComponentFixture, TestBed, getTestBed} from '@angular/core/testing';
|
|||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {DomSanitizer} from '@angular/platform-browser/src/security/dom_sanitization_service';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('jit', () => { declareTests({useJit: true}); });
|
||||
|
||||
describe('no jit', () => { declareTests({useJit: false}); });
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
|
||||
import {ResourceLoader} from '@angular/compiler';
|
||||
import {SourceMap} from '@angular/compiler/src/output/source_map';
|
||||
import {extractSourceMap, originalPositionFor} from '@angular/compiler/test/output/source_map_util';
|
||||
import {extractSourceMap, originalPositionFor} from '@angular/compiler/testing/src/output/source_map_util';
|
||||
import {MockResourceLoader} from '@angular/compiler/testing/src/resource_loader_mock';
|
||||
import {Attribute, Component, Directive, ErrorHandler, ɵglobal} from '@angular/core';
|
||||
import {getErrorLogger} from '@angular/core/src/errors';
|
||||
import {ComponentFixture, TestBed, fakeAsync, tick} from '@angular/core/testing';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('jit source mapping', () => {
|
||||
let jitSpy: jasmine.Spy;
|
||||
let resourceLoader: MockResourceLoader;
|
||||
|
|
|
@ -20,7 +20,7 @@ function mockSystem(modules: {[module: string]: any}) {
|
|||
};
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('SystemJsNgModuleLoader', () => {
|
||||
let oldSystem: any = null;
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -182,7 +182,7 @@ export class DuplicatePipe2 implements PipeTransform {
|
|||
class TestComp {
|
||||
}
|
||||
|
||||
export function main() {
|
||||
(function() {
|
||||
function createComponentFixture<T>(
|
||||
template: string, providers?: Provider[] | null, comp?: Type<T>): ComponentFixture<T> {
|
||||
if (!comp) {
|
||||
|
@ -932,7 +932,7 @@ export function main() {
|
|||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
class TestValue {
|
||||
constructor(public value: string) {}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import {Component, Directive, ElementRef, Input, NO_ERRORS_SCHEMA, QueryList, ViewChild, ViewChildren} from '@angular/core';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('ViewChild', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
|
|
|
@ -67,7 +67,7 @@ class TestObj {
|
|||
identity(arg: any) { return arg; }
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Reflector', () => {
|
||||
let reflector: Reflector;
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ class MockNgZone extends NgZone {
|
|||
stable(): void { this.onStable.emit(null); }
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Testability', () => {
|
||||
let testability: Testability;
|
||||
let execute: any;
|
||||
|
|
|
@ -19,7 +19,7 @@ class SpyTestObj extends SpyObject {
|
|||
constructor() { super(TestObj); }
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('testing', () => {
|
||||
describe('equality', () => {
|
||||
it('should structurally compare objects', () => {
|
||||
|
|
|
@ -12,7 +12,7 @@ import {ANNOTATIONS, makeDecorator, makePropDecorator} from '../../src/util/deco
|
|||
class DecoratedParent {}
|
||||
class DecoratedChild extends DecoratedParent {}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
const TerminalDecorator =
|
||||
makeDecorator('TerminalDecorator', (data: any) => ({terminal: true, ...data}));
|
||||
const TestDecorator = makeDecorator(
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import {isObservable, isPromise} from '@angular/core/src/util/lang';
|
||||
import {of } from 'rxjs/observable/of';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('isPromise', () => {
|
||||
it('should be true for native Promises',
|
||||
() => expect(isPromise(Promise.resolve(true))).toEqual(true));
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {stringify} from '../src/util';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('stringify', () => {
|
||||
it('should return string undefined when toString returns undefined',
|
||||
() => expect(stringify({toString: (): any => undefined})).toBe('undefined'));
|
||||
|
|
|
@ -12,7 +12,7 @@ import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
|||
|
||||
import {compViewDef, createAndGetRootNodes} from './helper';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe(`View Anchor`, () => {
|
||||
|
||||
describe('create', () => {
|
||||
|
|
|
@ -20,7 +20,7 @@ import {callMostRecentEventListenerHandler, compViewDef, createAndGetRootNodes,
|
|||
*/
|
||||
const addEventListener = '__zone_symbol__addEventListener';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe(`Component Views`, () => {
|
||||
it('should create and attach component views', () => {
|
||||
let instance: AComp = undefined !;
|
||||
|
|
|
@ -23,7 +23,7 @@ import {ARG_TYPE_VALUES, callMostRecentEventListenerHandler, checkNodeInlineOrDy
|
|||
const addEventListener = '__zone_symbol__addEventListener';
|
||||
const removeEventListener = '__zone_symbol__removeEventListener';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe(`View Elements`, () => {
|
||||
|
||||
describe('create', () => {
|
||||
|
|
|
@ -12,7 +12,7 @@ import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
|||
|
||||
import {compViewDef, compViewDefFactory, createAndGetRootNodes, createEmbeddedView} from './helper';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe(`Embedded Views`, () => {
|
||||
|
||||
it('should create embedded views with the right context', () => {
|
||||
|
|
|
@ -12,7 +12,7 @@ import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
|||
|
||||
import {compViewDef, compViewDefFactory, createEmbeddedView, createRootView, isBrowser} from './helper';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe(`View NgContent`, () => {
|
||||
function hostElDef(
|
||||
checkIndex: number, contentNodes: NodeDef[], viewNodes: NodeDef[]): NodeDef[] {
|
||||
|
|
|
@ -14,7 +14,7 @@ import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
|||
|
||||
import {ARG_TYPE_VALUES, checkNodeInlineOrDynamic, createRootView, createAndGetRootNodes, compViewDef, compViewDefFactory} from './helper';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe(`View Providers`, () => {
|
||||
|
||||
describe('create', () => {
|
||||
|
|
|
@ -11,7 +11,7 @@ import {NodeFlags, Services, asProviderData, directiveDef, elementDef, nodeValue
|
|||
|
||||
import {ARG_TYPE_VALUES, checkNodeInlineOrDynamic, compViewDef, createAndGetRootNodes} from './helper';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe(`View Pure Expressions`, () => {
|
||||
|
||||
class Service {
|
||||
|
|
|
@ -12,7 +12,7 @@ import {NodeDef, NodeFlags, QueryBindingType, QueryValueType, Services, anchorDe
|
|||
|
||||
import {compViewDef, compViewDefFactory, createAndGetRootNodes, createEmbeddedView} from './helper';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe(`Query Views`, () => {
|
||||
|
||||
const someQueryId = 1;
|
||||
|
|
|
@ -10,7 +10,7 @@ import {DebugContext, NodeFlags, QueryValueType, Services, asElementData, asText
|
|||
|
||||
import {compViewDef, createAndGetRootNodes} from './helper';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('View Services', () => {
|
||||
|
||||
describe('DebugContext', () => {
|
||||
|
|
|
@ -12,7 +12,7 @@ import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
|||
|
||||
import {ARG_TYPE_VALUES, checkNodeInlineOrDynamic, compViewDef, createAndGetRootNodes} from './helper';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe(`View Text`, () => {
|
||||
|
||||
describe('create', () => {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import {NodeFlags, QueryValueType, ViewDefinition, ViewFlags, anchorDef, directiveDef, elementDef, textDef, viewDef} from '@angular/core/src/view/index';
|
||||
import {filterQueryId} from '@angular/core/src/view/util';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('viewDef', () => {
|
||||
|
||||
describe('parent', () => {
|
||||
|
|
|
@ -62,9 +62,8 @@ function runNgZoneNoLog(fn: () => any) {
|
|||
}
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('NgZone', () => {
|
||||
|
||||
function createZone(enableLongStackTrace: boolean) {
|
||||
return new NgZone({enableLongStackTrace: enableLongStackTrace});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue