parent
47bcb5bc35
commit
47e251a80a
|
@ -18,7 +18,7 @@ function createDiv() {
|
|||
return document.createElement('div');
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Animation', () => {
|
||||
// these tests are only mean't to be run within the DOM (for now)
|
||||
if (typeof Element == 'undefined') return;
|
||||
|
|
|
@ -14,7 +14,7 @@ import {ENTER_CLASSNAME, LEAVE_CLASSNAME} from '../../src/util';
|
|||
import {MockAnimationDriver} from '../../testing';
|
||||
import {makeTrigger} from '../shared';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('AnimationTrigger', () => {
|
||||
// these tests are only mean't to be run within the DOM (for now)
|
||||
if (typeof Element == 'undefined') return;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
import {WebAnimationsStyleNormalizer} from '../../../src/dsl/style_normalization/web_animations_style_normalizer';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('WebAnimationsStyleNormalizer', () => {
|
||||
const normalizer = new WebAnimationsStyleNormalizer();
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import {AnimationDriver} from '../../src/render/animation_driver';
|
|||
import {TimelineAnimationEngine} from '../../src/render/timeline_animation_engine';
|
||||
import {MockAnimationDriver, MockAnimationPlayer} from '../../testing/src/mock_animation_driver';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
const defaultDriver = new MockAnimationDriver();
|
||||
|
||||
function makeEngine(driver?: AnimationDriver, normalizer?: AnimationStyleNormalizer) {
|
||||
|
@ -93,7 +93,7 @@ export function main() {
|
|||
expect(player.keyframes).toEqual([{width: '*star*', offset: 0}, {width: '999px', offset: 1}]);
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
function invokeAnimation(
|
||||
engine: TimelineAnimationEngine, element: any, steps: AnimationMetadata | AnimationMetadata[],
|
||||
|
|
|
@ -16,7 +16,7 @@ import {MockAnimationDriver, MockAnimationPlayer} from '../../testing/src/mock_a
|
|||
|
||||
const DEFAULT_NAMESPACE_ID = 'id';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
const driver = new MockAnimationDriver();
|
||||
|
||||
// these tests are only mean't to be run within the DOM
|
||||
|
@ -616,7 +616,7 @@ export function main() {
|
|||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
class SuffixNormalizer extends AnimationStyleNormalizer {
|
||||
constructor(private _suffix: string) { super(); }
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import {DOMAnimation} from '../../../src/render/web_animations/dom_animation';
|
||||
import {WebAnimationsPlayer} from '../../../src/render/web_animations/web_animations_player';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
let element: any;
|
||||
let innerPlayer: MockDomAnimation|null = null;
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -10,7 +10,7 @@ import {flushMicrotasks} from '../../core/testing/src/fake_async';
|
|||
import {NoopAnimationPlayer} from '../src/players/animation_player';
|
||||
import {scheduleMicroTask} from '../src/util';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('NoopAnimationPlayer', function() {
|
||||
it('should finish after the next microtask once started', fakeAsync(() => {
|
||||
const log: string[] = [];
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
import {scheduleMicroTask} from '../src/util';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('util', () => {
|
||||
it('should schedule a microtask and not call an async timeout', (done) => {
|
||||
let count = 0;
|
||||
|
|
|
@ -19,7 +19,7 @@ function assertEventsEqual(actualEvents: any[], expectedEvents: any[]) {
|
|||
}
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('convertPerfProfileToEvents', function() {
|
||||
it('should convert single instantaneous event', function() {
|
||||
const profileData = {
|
||||
|
|
|
@ -10,7 +10,7 @@ import {AsyncTestCompleter, describe, expect, inject, it} from '@angular/core/te
|
|||
|
||||
import {Injector, Metric, MultiMetric} from '../../index';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
function createMetric(ids: any[]) {
|
||||
const m = Injector
|
||||
.create([
|
||||
|
@ -49,7 +49,7 @@ export function main() {
|
|||
});
|
||||
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
class MockMetric extends Metric {
|
||||
constructor(private _id: string) { super(); }
|
||||
|
|
|
@ -12,7 +12,7 @@ import {AsyncTestCompleter, beforeEach, describe, expect, inject, it} from '@ang
|
|||
import {Injector, Metric, Options, PerfLogEvent, PerfLogFeatures, PerflogMetric, WebDriverExtension} from '../../index';
|
||||
import {TraceEventFactory} from '../trace_event_factory';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
let commandLog: any[];
|
||||
const eventFactory = new TraceEventFactory('timeline', 'pid0');
|
||||
|
||||
|
@ -680,7 +680,7 @@ export function main() {
|
|||
});
|
||||
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
class MockDriverExtension extends WebDriverExtension {
|
||||
constructor(
|
||||
|
|
|
@ -11,7 +11,7 @@ import {AsyncTestCompleter, describe, expect, inject, it} from '@angular/core/te
|
|||
|
||||
import {Options, PerfLogEvent, PerfLogFeatures, UserMetric, WebDriverAdapter} from '../../index';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
let wdAdapter: MockDriverAdapter;
|
||||
|
||||
function createMetric(
|
||||
|
@ -63,7 +63,7 @@ export function main() {
|
|||
}), 600);
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
class MockDriverAdapter extends WebDriverAdapter {
|
||||
data: any = {};
|
||||
|
|
|
@ -11,7 +11,7 @@ import {describe, expect, it} from '@angular/core/testing/src/testing_internal';
|
|||
|
||||
import {ConsoleReporter, Injector, MeasureValues, SampleDescription} from '../../index';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('console reporter', () => {
|
||||
let reporter: ConsoleReporter;
|
||||
let log: string[];
|
||||
|
|
|
@ -10,7 +10,7 @@ import {AsyncTestCompleter, describe, expect, inject, it} from '@angular/core/te
|
|||
|
||||
import {Injector, JsonFileReporter, MeasureValues, Options, SampleDescription} from '../../index';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('file reporter', () => {
|
||||
let loggedFile: any;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import {AsyncTestCompleter, describe, expect, inject, it} from '@angular/core/te
|
|||
|
||||
import {Injector, MeasureValues, MultiReporter, Reporter} from '../../index';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
function createReporters(ids: any[]) {
|
||||
const r = Injector
|
||||
.create([
|
||||
|
@ -51,7 +51,7 @@ export function main() {
|
|||
}));
|
||||
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
class MockReporter extends Reporter {
|
||||
constructor(private _id: string) { super(); }
|
||||
|
|
|
@ -10,7 +10,7 @@ import {AsyncTestCompleter, describe, expect, inject, it} from '@angular/core/te
|
|||
|
||||
import {Injector, Metric, Options, Runner, SampleDescription, SampleState, Sampler, Validator, WebDriverAdapter} from '../index';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('runner', () => {
|
||||
let injector: Injector;
|
||||
let runner: Runner;
|
||||
|
|
|
@ -10,7 +10,7 @@ import {AsyncTestCompleter, describe, expect, inject, it} from '@angular/core/te
|
|||
|
||||
import {Injector, MeasureValues, Metric, Options, Reporter, Sampler, Validator, WebDriverAdapter} from '../index';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
const EMPTY_EXECUTE = () => {};
|
||||
|
||||
describe('sampler', () => {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import {describe, expect, it} from '@angular/core/testing/src/testing_internal';
|
||||
import {Statistic} from '../src/statistic';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('statistic', () => {
|
||||
|
||||
it('should calculate the mean', () => {
|
||||
|
|
|
@ -10,7 +10,7 @@ import {describe, expect, it} from '@angular/core/testing/src/testing_internal';
|
|||
|
||||
import {Injector, MeasureValues, RegressionSlopeValidator} from '../../index';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('regression slope validator', () => {
|
||||
let validator: RegressionSlopeValidator;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import {describe, expect, it} from '@angular/core/testing/src/testing_internal';
|
|||
|
||||
import {Injector, MeasureValues, SizeValidator} from '../../index';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('size validator', () => {
|
||||
let validator: SizeValidator;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import {AsyncTestCompleter, describe, expect, inject, it} from '@angular/core/te
|
|||
|
||||
import {Injector, Options, WebDriverExtension} from '../index';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
function createExtension(ids: any[], caps: any) {
|
||||
return new Promise<any>((res, rej) => {
|
||||
try {
|
||||
|
@ -45,7 +45,7 @@ export function main() {
|
|||
});
|
||||
}));
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
class MockExtension extends WebDriverExtension {
|
||||
constructor(public id: string) { super(); }
|
||||
|
|
|
@ -11,7 +11,7 @@ import {AsyncTestCompleter, describe, expect, iit, inject, it} from '@angular/co
|
|||
import {ChromeDriverExtension, Injector, Options, WebDriverAdapter, WebDriverExtension} from '../../index';
|
||||
import {TraceEventFactory} from '../trace_event_factory';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('chrome driver extension', () => {
|
||||
const CHROME45_USER_AGENT =
|
||||
'"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2499.0 Safari/537.36"';
|
||||
|
|
|
@ -11,7 +11,7 @@ import {AsyncTestCompleter, describe, expect, inject, it} from '@angular/core/te
|
|||
import {IOsDriverExtension, Injector, WebDriverAdapter, WebDriverExtension} from '../../index';
|
||||
import {TraceEventFactory} from '../trace_event_factory';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('ios driver extension', () => {
|
||||
let log: any[];
|
||||
let extension: IOsDriverExtension;
|
||||
|
|
|
@ -15,7 +15,7 @@ import {HttpClient} from '../src/client';
|
|||
import {HttpErrorResponse, HttpEventType, HttpResponse} from '../src/response';
|
||||
import {HttpClientTestingBackend} from '../testing/src/backend';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('HttpClient', () => {
|
||||
let client: HttpClient = null !;
|
||||
let backend: HttpClientTestingBackend = null !;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {HttpHeaders} from '../src/headers';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('HttpHeaders', () => {
|
||||
|
||||
describe('initialization', () => {
|
||||
|
|
|
@ -24,7 +24,7 @@ function runOnlyCallback(home: any, data: Object) {
|
|||
|
||||
const SAMPLE_REQ = new HttpRequest<never>('JSONP', '/test');
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('JsonpClientBackend', () => {
|
||||
let home = {};
|
||||
let document: MockDocument;
|
||||
|
|
|
@ -47,7 +47,7 @@ class InterceptorB extends TestInterceptor {
|
|||
constructor() { super('B'); }
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('HttpClientModule', () => {
|
||||
let injector: Injector;
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {HttpParams} from '../src/params';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('HttpUrlEncodedParams', () => {
|
||||
describe('initialization', () => {
|
||||
it('should be empty at construction', () => {
|
||||
|
|
|
@ -15,7 +15,7 @@ import {HttpRequest} from '../src/request';
|
|||
const TEST_URL = 'http://angular.io';
|
||||
const TEST_STRING = `I'm a body!`;
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('HttpRequest', () => {
|
||||
describe('constructor', () => {
|
||||
it('initializes url', () => {
|
||||
|
|
|
@ -11,7 +11,7 @@ import {ddescribe, describe, it} from '@angular/core/testing/src/testing_interna
|
|||
import {HttpHeaders} from '../src/headers';
|
||||
import {HttpResponse} from '../src/response';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('HttpResponse', () => {
|
||||
describe('constructor()', () => {
|
||||
it('fully constructs responses', () => {
|
||||
|
|
|
@ -27,7 +27,7 @@ const TEST_POST = new HttpRequest('POST', '/test', 'some body', {
|
|||
|
||||
const XSSI_PREFIX = ')]}\'\n';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('XhrBackend', () => {
|
||||
let factory: MockXhrFactory = null !;
|
||||
let backend: HttpXhrBackend = null !;
|
||||
|
|
|
@ -19,7 +19,7 @@ class SampleTokenExtractor {
|
|||
getToken(): string|null { return this.token; }
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('HttpXsrfInterceptor', () => {
|
||||
let backend: HttpClientTestingBackend;
|
||||
const interceptor = new HttpXsrfInterceptor(new SampleTokenExtractor('test'), 'X-XSRF-TOKEN');
|
||||
|
|
|
@ -12,7 +12,7 @@ import {DeprecatedI18NPipesModule} from '../src/common_module';
|
|||
import {Plural} from '../src/i18n/locale_data_api';
|
||||
import {DEPRECATED_PLURAL_FN, getPluralCase} from '../src/i18n/localization';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('DeprecatedI18NPipesModule', () => {
|
||||
beforeEach(() => { TestBed.configureTestingModule({imports: [DeprecatedI18NPipesModule]}); });
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import {parseCookieValue} from '@angular/common/src/cookie';
|
||||
import {describe, expect, it} from '@angular/core/testing/src/testing_internal';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('cookies', () => {
|
||||
it('parses cookies', () => {
|
||||
const cookie = 'other-cookie=false; xsrf-token=token-value; is_awesome=true; ffo=true;';
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import {Component} from '@angular/core';
|
||||
import {ComponentFixture, TestBed, async} from '@angular/core/testing';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('binding to CSS class list', () => {
|
||||
let fixture: ComponentFixture<any>|null;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import {Compiler, Component, ComponentRef, Inject, InjectionToken, Injector, NO_
|
|||
import {TestBed, async, fakeAsync} from '@angular/core/testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('insert/remove', () => {
|
||||
|
||||
beforeEach(() => { TestBed.configureTestingModule({imports: [TestModule]}); });
|
||||
|
|
|
@ -14,7 +14,7 @@ import {expect} from '@angular/platform-browser/testing/src/matchers';
|
|||
|
||||
let thisArg: any;
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('ngFor', () => {
|
||||
let fixture: ComponentFixture<any>;
|
||||
|
||||
|
|
|
@ -13,7 +13,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('ngIf directive', () => {
|
||||
let fixture: ComponentFixture<any>;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import {Component, Injectable} from '@angular/core';
|
|||
import {ComponentFixture, TestBed, async} from '@angular/core/testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('ngPlural', () => {
|
||||
let fixture: ComponentFixture<any>;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import {CommonModule} from '@angular/common';
|
|||
import {Component} from '@angular/core';
|
||||
import {ComponentFixture, TestBed, async} from '@angular/core/testing';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('NgStyle', () => {
|
||||
let fixture: ComponentFixture<any>;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import {Attribute, Component, Directive} from '@angular/core';
|
|||
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('NgSwitch', () => {
|
||||
let fixture: ComponentFixture<any>;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import {Component, ContentChildren, Directive, Injectable, NO_ERRORS_SCHEMA, OnD
|
|||
import {ComponentFixture, TestBed, async} from '@angular/core/testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('NgTemplateOutlet', () => {
|
||||
let fixture: ComponentFixture<any>;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import {ComponentFixture, TestBed, async} 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('non-bindable', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -13,7 +13,7 @@ import localeFrCA from '../../locales/fr-CA';
|
|||
import {registerLocaleData} from '../../src/i18n/locale_data';
|
||||
import {findLocaleData} from '../../src/i18n/locale_data_api';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('locale data api', () => {
|
||||
beforeAll(() => {
|
||||
registerLocaleData(localeCaESVALENCIA);
|
||||
|
|
|
@ -16,7 +16,7 @@ import {NgLocaleLocalization, NgLocalization, getPluralCategory, DEPRECATED_PLUR
|
|||
import {Plural} from '../../src/i18n/locale_data_api';
|
||||
import {registerLocaleData} from '../../src/i18n/locale_data';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('l10n', () => {
|
||||
beforeAll(() => {
|
||||
registerLocaleData(localeRo);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {Location} from '../../src/location/location';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
const baseUrl = '/base';
|
||||
|
||||
describe('Location Class', () => {
|
||||
|
|
|
@ -14,7 +14,7 @@ import {browserDetection} from '@angular/platform-browser/testing/src/browser_ut
|
|||
|
||||
import {SpyChangeDetectorRef} from '../spies';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('AsyncPipe', () => {
|
||||
|
||||
describe('Observable', () => {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {LowerCasePipe, TitleCasePipe, UpperCasePipe} from '@angular/common';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('LowerCasePipe', () => {
|
||||
let pipe: LowerCasePipe;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import localeHu from '../../locales/hu';
|
|||
import localeSr from '../../locales/sr';
|
||||
import localeTh from '../../locales/th';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('DatePipe', () => {
|
||||
let date: Date;
|
||||
const isoStringWithoutTime = '2015-01-01';
|
||||
|
|
|
@ -11,7 +11,7 @@ import {PipeResolver} from '@angular/compiler/src/pipe_resolver';
|
|||
import {JitReflector} from '@angular/platform-browser-dynamic/src/compiler_reflector';
|
||||
import {browserDetection} from '@angular/platform-browser/testing/src/browser_util';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('DeprecatedDatePipe', () => {
|
||||
let date: Date;
|
||||
const isoStringWithoutTime = '2015-01-01';
|
||||
|
|
|
@ -10,7 +10,7 @@ import {DeprecatedCurrencyPipe, DeprecatedDecimalPipe, DeprecatedPercentPipe} fr
|
|||
import {beforeEach, describe, expect, it} from '@angular/core/testing/src/testing_internal';
|
||||
import {browserDetection} from '@angular/platform-browser/testing/src/browser_util';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
function isNumeric(value: any): boolean { return !isNaN(value - parseFloat(value)); }
|
||||
|
||||
// Between the symbol and the number, Edge adds a no breaking space and IE11 adds a standard space
|
||||
|
@ -106,4 +106,4 @@ export function main() {
|
|||
() => { expect(isNumeric('2a')).toBe(false); });
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
|
|
@ -11,7 +11,7 @@ import {PipeResolver} from '@angular/compiler/src/pipe_resolver';
|
|||
import {beforeEach, describe, expect, it} from '@angular/core/testing/src/testing_internal';
|
||||
import {JitReflector} from '@angular/platform-browser-dynamic/src/compiler_reflector';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('I18nPluralPipe', () => {
|
||||
let localization: NgLocalization;
|
||||
let pipe: I18nPluralPipe;
|
||||
|
|
|
@ -10,7 +10,7 @@ import {I18nSelectPipe} from '@angular/common';
|
|||
import {PipeResolver} from '@angular/compiler/src/pipe_resolver';
|
||||
import {JitReflector} from '@angular/platform-browser-dynamic/src/compiler_reflector';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('I18nSelectPipe', () => {
|
||||
const pipe: I18nSelectPipe = new I18nSelectPipe();
|
||||
const mapping = {'male': 'Invite him.', 'female': 'Invite her.', 'other': 'Invite them.'};
|
||||
|
|
|
@ -11,7 +11,7 @@ import {Component} from '@angular/core';
|
|||
import {TestBed, async} from '@angular/core/testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('JsonPipe', () => {
|
||||
const regNewLine = '\n';
|
||||
let inceptionObj: any;
|
||||
|
|
|
@ -12,7 +12,7 @@ import localeFr from '../../locales/fr';
|
|||
import {registerLocaleData, CurrencyPipe, DecimalPipe, PercentPipe} from '@angular/common';
|
||||
import {beforeEach, describe, expect, it} from '@angular/core/testing/src/testing_internal';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Number pipes', () => {
|
||||
beforeAll(() => {
|
||||
registerLocaleData(localeEn);
|
||||
|
|
|
@ -11,7 +11,7 @@ import {Component} from '@angular/core';
|
|||
import {TestBed, async} from '@angular/core/testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('SlicePipe', () => {
|
||||
let list: number[];
|
||||
let str: string;
|
||||
|
|
|
@ -16,7 +16,7 @@ import {MockStaticSymbolResolverHost, MockSummaryResolver} from './static_symbol
|
|||
|
||||
const EXT = /(\.d)?\.ts$/;
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('AotSummaryResolver', () => {
|
||||
let summaryResolver: AotSummaryResolver;
|
||||
let symbolCache: StaticSymbolCache;
|
||||
|
|
|
@ -15,7 +15,7 @@ import {MockStaticSymbolResolverHost} from './static_symbol_resolver_spec';
|
|||
import {MockAotSummaryResolverHost, createMockOutputContext} from './summary_resolver_spec';
|
||||
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('summary serializer', () => {
|
||||
let summaryResolver: AotSummaryResolver;
|
||||
let symbolResolver: StaticSymbolResolver;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import {MissingTranslationStrategy} from '@angular/core';
|
||||
import {CompilerConfig} from '../src/config';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('compiler config', () => {
|
||||
it('should set missing translation strategy', () => {
|
||||
const config = new CompilerConfig({missingTranslation: MissingTranslationStrategy.Error});
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import {core as compilerCore} from '@angular/compiler';
|
||||
import * as core from '@angular/core';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('compiler core', () => {
|
||||
it('Attribute should be equal', () => {
|
||||
typeExtends<compilerCore.Attribute, core.Attribute>();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import {describe, expect, it} from '../../../core/testing/src/testing_internal';
|
||||
import {CssLexer, CssLexerMode, CssToken, CssTokenType, cssScannerError, getRawMessage, getToken} from '../../src/css_parser/css_lexer';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
function tokenize(
|
||||
code: string, trackComments: boolean = false,
|
||||
mode: CssLexerMode = CssLexerMode.ALL): CssToken[] {
|
||||
|
@ -373,4 +373,4 @@ export function main() {
|
|||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
|
|
@ -18,7 +18,7 @@ export function assertTokens(tokens: CssToken[], valuesArr: string[]) {
|
|||
}
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('CssParser', () => {
|
||||
function parse(css: string): ParsedCssResult {
|
||||
return new CssParser().parse(css, 'some-fake-css-file.css');
|
||||
|
|
|
@ -115,7 +115,7 @@ function _getCaptureAst(capture: any[], index = 0): CssAst {
|
|||
return <CssAst>capture[index][0];
|
||||
}
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
function parse(cssCode: string, ignoreErrors: boolean = false) {
|
||||
const output = new CssParser().parse(cssCode, 'some-fake-css-file.css');
|
||||
const errors = output.errors;
|
||||
|
@ -318,4 +318,4 @@ export function main() {
|
|||
_assertTokens(rule.tokens, ['six', 'seven', 'eight']);
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
|
|
@ -14,7 +14,7 @@ function hasLifecycleHook(hook: Hooks, directive: any): boolean {
|
|||
return hasLifecycleHookImpl(new JitReflector(), hook, directive);
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Create Directive', () => {
|
||||
describe('lifecycle', () => {
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ function normalizeTemplate(normalizer: DirectiveNormalizer, o: {
|
|||
});
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('DirectiveNormalizer', () => {
|
||||
let resourceLoaderSpy: jasmine.Spy;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import {JitReflector} from '@angular/platform-browser-dynamic/src/compiler_refle
|
|||
|
||||
import {MockDirectiveResolver} from '../testing';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('MockDirectiveResolver', () => {
|
||||
let dirResolver: MockDirectiveResolver;
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ class SomeDirectiveWithMalformedHostBinding2 {
|
|||
|
||||
class SomeDirectiveWithoutMetadata {}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('DirectiveResolver', () => {
|
||||
let resolver: DirectiveResolver;
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ function expectErrorToken(token: Token, index: any, message: string) {
|
|||
expect(token.toString()).toEqual(message);
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('lexer', () => {
|
||||
describe('token', () => {
|
||||
it('should tokenize a simple identifier', () => {
|
||||
|
|
|
@ -15,7 +15,7 @@ import {expect} from '@angular/platform-browser/testing/src/matchers';
|
|||
import {unparse} from './unparser';
|
||||
import {validate} from './validator';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
function createParser() { return new Parser(new Lexer()); }
|
||||
|
||||
function parseAction(text: string, location: any = null): ASTWithSource {
|
||||
|
@ -604,4 +604,4 @@ export function main() {
|
|||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {computeMsgId, digest, sha1} from '../../src/i18n/digest';
|
||||
|
||||
export function main(): void {
|
||||
{
|
||||
describe('digest', () => {
|
||||
describe('digest', () => {
|
||||
it('must return the ID if it\'s explicit', () => {
|
||||
|
|
|
@ -16,7 +16,7 @@ import {TranslationBundle} from '../../src/i18n/translation_bundle';
|
|||
import * as html from '../../src/ml_parser/ast';
|
||||
import {serializeNodes as serializeHtmlNodes} from '../ml_parser/ast_serializer_spec';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Extractor', () => {
|
||||
describe('elements', () => {
|
||||
it('should extract from elements', () => {
|
||||
|
|
|
@ -11,7 +11,7 @@ import {TranslationBundle} from '@angular/compiler/src/i18n/translation_bundle';
|
|||
import {HtmlParser} from '@angular/compiler/src/ml_parser/html_parser';
|
||||
import {ParseTreeResult} from '@angular/compiler/src/ml_parser/parser';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('I18N html parser', () => {
|
||||
// https://github.com/angular/angular/issues/14322
|
||||
it('should parse the translations only once', () => {
|
||||
|
|
|
@ -12,7 +12,7 @@ import {Message} from '@angular/compiler/src/i18n/i18n_ast';
|
|||
import {HtmlParser} from '@angular/compiler/src/ml_parser/html_parser';
|
||||
import {DEFAULT_INTERPOLATION_CONFIG} from '@angular/compiler/src/ml_parser/interpolation_config';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('I18nParser', () => {
|
||||
|
||||
describe('elements', () => {
|
||||
|
|
|
@ -20,7 +20,7 @@ import {SpyResourceLoader} from '../spies';
|
|||
|
||||
import {FrLocalization, HTML, I18nComponent, validateHtml} from './integration_common';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('i18n XLIFF 2.0 integration spec', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
|
|
|
@ -20,7 +20,7 @@ import {SpyResourceLoader} from '../spies';
|
|||
|
||||
import {FrLocalization, HTML, I18nComponent, validateHtml} from './integration_common';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('i18n XLIFF integration spec', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
|
|
|
@ -20,7 +20,7 @@ import {SpyResourceLoader} from '../spies';
|
|||
|
||||
import {FrLocalization, HTML, I18nComponent, validateHtml} from './integration_common';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('i18n XMB/XTB integration spec', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
|
|
|
@ -13,7 +13,7 @@ import {Serializer} from '../../src/i18n/serializers/serializer';
|
|||
import {HtmlParser} from '../../src/ml_parser/html_parser';
|
||||
import {DEFAULT_INTERPOLATION_CONFIG} from '../../src/ml_parser/interpolation_config';
|
||||
|
||||
export function main(): void {
|
||||
{
|
||||
describe('MessageBundle', () => {
|
||||
describe('Messages', () => {
|
||||
let messages: MessageBundle;
|
||||
|
|
|
@ -11,7 +11,7 @@ import * as i18n from '@angular/compiler/src/i18n/i18n_ast';
|
|||
import {serializeNodes} from '../../../src/i18n/digest';
|
||||
import {_extractMessages} from '../i18n_parser_spec';
|
||||
|
||||
export function main(): void {
|
||||
{
|
||||
describe('i18n AST', () => {
|
||||
describe('CloneVisitor', () => {
|
||||
it('should clone an AST', () => {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {PlaceholderRegistry} from '../../../src/i18n/serializers/placeholder';
|
||||
|
||||
export function main(): void {
|
||||
{
|
||||
describe('PlaceholderRegistry', () => {
|
||||
let reg: PlaceholderRegistry;
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ lignes</target>
|
|||
</xliff>
|
||||
`;
|
||||
|
||||
export function main(): void {
|
||||
(function(){
|
||||
const serializer = new Xliff2();
|
||||
|
||||
function toXliff(html: string, locale: string | null = null): string {
|
||||
|
@ -413,4 +413,4 @@ lignes`
|
|||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
|
|
@ -226,7 +226,7 @@ lignes</target>
|
|||
</xliff>
|
||||
`;
|
||||
|
||||
export function main(): void {
|
||||
(function(){
|
||||
const serializer = new Xliff();
|
||||
|
||||
function toXliff(html: string, locale: string | null = null): string {
|
||||
|
@ -381,4 +381,4 @@ lignes`
|
|||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
|
|
@ -11,7 +11,7 @@ import {Xmb} from '@angular/compiler/src/i18n/serializers/xmb';
|
|||
import {HtmlParser} from '@angular/compiler/src/ml_parser/html_parser';
|
||||
import {DEFAULT_INTERPOLATION_CONFIG} from '@angular/compiler/src/ml_parser/interpolation_config';
|
||||
|
||||
export function main(): void {
|
||||
{
|
||||
describe('XMB serializer', () => {
|
||||
const HTML = `
|
||||
<p>not translatable</p>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import * as xml from '../../../src/i18n/serializers/xml_helper';
|
||||
|
||||
export function main(): void {
|
||||
{
|
||||
describe('XML helper', () => {
|
||||
it('should serialize XML declaration', () => {
|
||||
expect(xml.serialize([new xml.Declaration({version: '1.0'})]))
|
||||
|
|
|
@ -12,7 +12,7 @@ import * as i18n from '../../../src/i18n/i18n_ast';
|
|||
import {Xtb} from '../../../src/i18n/serializers/xtb';
|
||||
|
||||
|
||||
export function main(): void {
|
||||
{
|
||||
describe('XTB serializer', () => {
|
||||
const serializer = new Xtb();
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import {ParseLocation, ParseSourceFile, ParseSourceSpan} from '../../src/parse_u
|
|||
import {serializeNodes} from '../ml_parser/ast_serializer_spec';
|
||||
import {_extractMessages} from './i18n_parser_spec';
|
||||
|
||||
export function main(): void {
|
||||
{
|
||||
describe('TranslationBundle', () => {
|
||||
const file = new ParseSourceFile('content', 'url');
|
||||
const startLocation = new ParseLocation(file, 0, 0, 0);
|
||||
|
|
|
@ -12,7 +12,7 @@ import {By} from '@angular/platform-browser/src/dom/debug/by';
|
|||
import {browserDetection} from '@angular/platform-browser/testing/src/browser_util';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('integration tests', () => {
|
||||
let fixture: ComponentFixture<TestComponent>;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import {MockResourceLoader} from '../testing/src/resource_loader_mock';
|
|||
import {MalformedStylesComponent} from './metadata_resolver_fixture';
|
||||
import {TEST_COMPILER_PROVIDERS} from './test_bindings';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('CompileMetadataResolver', () => {
|
||||
beforeEach(() => { TestBed.configureCompiler({providers: TEST_COMPILER_PROVIDERS}); });
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import * as html from '@angular/compiler/src/ml_parser/ast';
|
|||
import {HtmlParser} from '@angular/compiler/src/ml_parser/html_parser';
|
||||
import {getHtmlTagDefinition} from '@angular/compiler/src/ml_parser/html_tags';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Node serializer', () => {
|
||||
let parser: HtmlParser;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import {ParseError} from '../../src/parse_util';
|
|||
|
||||
import {humanizeDom, humanizeDomSourceSpans, humanizeLineColumn} from './ast_spec_utils';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('HtmlParser', () => {
|
||||
let parser: HtmlParser;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import {PRESERVE_WS_ATTR_NAME, removeWhitespaces} from '../../src/ml_parser/html
|
|||
|
||||
import {humanizeDom} from './ast_spec_utils';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('removeWhitespaces', () => {
|
||||
|
||||
function parseAndRemoveWS(template: string): any[] {
|
||||
|
|
|
@ -13,7 +13,7 @@ import {ParseError} from '../../src/parse_util';
|
|||
|
||||
import {humanizeNodes} from './ast_spec_utils';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Expander', () => {
|
||||
function expand(template: string): ExpansionResult {
|
||||
const htmlParser = new HtmlParser();
|
||||
|
|
|
@ -11,7 +11,7 @@ import {InterpolationConfig} from '../../src/ml_parser/interpolation_config';
|
|||
import * as lex from '../../src/ml_parser/lexer';
|
||||
import {ParseLocation, ParseSourceFile, ParseSourceSpan} from '../../src/parse_util';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('HtmlLexer', () => {
|
||||
describe('line/column numbers', () => {
|
||||
it('should work without newlines', () => {
|
||||
|
|
|
@ -12,7 +12,7 @@ import {JitReflector} from '@angular/platform-browser-dynamic/src/compiler_refle
|
|||
|
||||
import {MockNgModuleResolver} from '../testing';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('MockNgModuleResolver', () => {
|
||||
let ngModuleResolver: MockNgModuleResolver;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class SomeModule {
|
|||
|
||||
class SimpleClass {}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('NgModuleResolver', () => {
|
||||
let resolver: NgModuleResolver;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import {EmitterVisitorContext} from '@angular/compiler/src/output/abstract_emitt
|
|||
import {SourceMap} from '@angular/compiler/src/output/source_map';
|
||||
import {extractSourceMap, originalPositionFor} from '@angular/compiler/testing/src/output/source_map_util';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('AbstractEmitter', () => {
|
||||
describe('EmitterVisitorContext', () => {
|
||||
const fileA = new ParseSourceFile('a0a1a2a3a4a5a6a7a8a9', 'a.js');
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {escapeIdentifier} from '@angular/compiler/src/output/abstract_emitter';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('AbstractEmitter', () => {
|
||||
describe('escapeIdentifier', () => {
|
||||
it('should escape single quotes',
|
||||
|
|
|
@ -17,7 +17,7 @@ import {extractSourceMap, originalPositionFor} from '@angular/compiler/testing/s
|
|||
|
||||
const someGenFilePath = 'somePackage/someGenFile';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('JavaScriptEmitter', () => {
|
||||
let emitter: JavaScriptEmitter;
|
||||
let someVar: o.ReadVarExpr;
|
||||
|
|
|
@ -19,7 +19,7 @@ const sameModuleIdentifier = new o.ExternalReference(null, 'someLocalId', null);
|
|||
|
||||
const externalModuleIdentifier = new o.ExternalReference(anotherModuleUrl, 'someExternalId', null);
|
||||
|
||||
export function main() {
|
||||
{
|
||||
// Note supported features of our OutputAstin JavaScript / ES5:
|
||||
// - types
|
||||
// - declaring fields
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import * as o from '../../src/output/output_ast';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('OutputAst', () => {
|
||||
describe('collectExternalReferences', () => {
|
||||
it('should find expressions of variable types', () => {
|
||||
|
|
|
@ -13,7 +13,7 @@ import {JitReflector} from '@angular/platform-browser-dynamic/src/compiler_refle
|
|||
|
||||
const anotherModuleUrl = 'somePackage/someOtherPath';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Output JIT', () => {
|
||||
describe('regression', () => {
|
||||
it('should generate unique argument names', () => {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue