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