build: remove `main()` from specs (#21053)

PR Close #21053
This commit is contained in:
Misko Hevery 2017-12-16 14:42:55 -08:00 committed by Igor Minar
parent 47bcb5bc35
commit 47e251a80a
191 changed files with 424 additions and 424 deletions

View File

@ -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;

View File

@ -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;

View File

@ -7,7 +7,7 @@
*/
import {WebAnimationsStyleNormalizer} from '../../../src/dsl/style_normalization/web_animations_style_normalizer';
export function main() {
{
describe('WebAnimationsStyleNormalizer', () => {
const normalizer = new WebAnimationsStyleNormalizer();

View File

@ -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[],

View File

@ -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(); }

View File

@ -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(() => {

View File

@ -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[] = [];

View File

@ -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;

View File

@ -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 = {

View File

@ -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(); }

View File

@ -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(

View File

@ -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 = {};

View File

@ -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[];

View File

@ -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;

View File

@ -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(); }

View File

@ -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;

View File

@ -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', () => {

View File

@ -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', () => {

View File

@ -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;

View File

@ -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;

View File

@ -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(); }

View File

@ -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"';

View File

@ -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;

View File

@ -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 !;

View File

@ -8,7 +8,7 @@
import {HttpHeaders} from '../src/headers';
export function main() {
{
describe('HttpHeaders', () => {
describe('initialization', () => {

View File

@ -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;

View File

@ -47,7 +47,7 @@ class InterceptorB extends TestInterceptor {
constructor() { super('B'); }
}
export function main() {
{
describe('HttpClientModule', () => {
let injector: Injector;
beforeEach(() => {

View File

@ -8,7 +8,7 @@
import {HttpParams} from '../src/params';
export function main() {
{
describe('HttpUrlEncodedParams', () => {
describe('initialization', () => {
it('should be empty at construction', () => {

View File

@ -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', () => {

View File

@ -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', () => {

View File

@ -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 !;

View File

@ -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');

View File

@ -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]}); });

View File

@ -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;';

View File

@ -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;

View File

@ -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]}); });

View File

@ -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>;

View File

@ -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>;

View File

@ -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>;

View File

@ -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>;

View File

@ -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>;

View File

@ -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>;

View File

@ -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(() => {

View File

@ -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);

View File

@ -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);

View File

@ -8,7 +8,7 @@
import {Location} from '../../src/location/location';
export function main() {
{
const baseUrl = '/base';
describe('Location Class', () => {

View File

@ -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', () => {

View File

@ -8,7 +8,7 @@
import {LowerCasePipe, TitleCasePipe, UpperCasePipe} from '@angular/common';
export function main() {
{
describe('LowerCasePipe', () => {
let pipe: LowerCasePipe;

View File

@ -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';

View File

@ -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';

View File

@ -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); });
});
});
}
})();

View File

@ -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;

View File

@ -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.'};

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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});

View File

@ -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>();

View File

@ -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() {
});
});
});
}
})();

View File

@ -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');

View File

@ -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']);
});
});
}
})();

View File

@ -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', () => {

View File

@ -42,7 +42,7 @@ function normalizeTemplate(normalizer: DirectiveNormalizer, o: {
});
}
export function main() {
{
describe('DirectiveNormalizer', () => {
let resourceLoaderSpy: jasmine.Spy;

View File

@ -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;

View File

@ -112,7 +112,7 @@ class SomeDirectiveWithMalformedHostBinding2 {
class SomeDirectiveWithoutMetadata {}
export function main() {
{
describe('DirectiveResolver', () => {
let resolver: DirectiveResolver;

View File

@ -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', () => {

View File

@ -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() {
});
});
});
}
})();

View File

@ -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', () => {

View File

@ -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', () => {

View File

@ -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', () => {

View File

@ -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', () => {

View File

@ -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(() => {

View File

@ -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(() => {

View File

@ -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(() => {

View File

@ -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;

View File

@ -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', () => {

View File

@ -8,7 +8,7 @@
import {PlaceholderRegistry} from '../../../src/i18n/serializers/placeholder';
export function main(): void {
{
describe('PlaceholderRegistry', () => {
let reg: PlaceholderRegistry;

View File

@ -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`
});
});
});
}
})();

View File

@ -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`
});
});
});
}
})();

View File

@ -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>

View File

@ -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'})]))

View File

@ -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();

View File

@ -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);

View File

@ -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>;

View File

@ -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}); });

View File

@ -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;

View File

@ -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;

View File

@ -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[] {

View File

@ -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();

View File

@ -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', () => {

View File

@ -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;

View File

@ -29,7 +29,7 @@ class SomeModule {
class SimpleClass {}
export function main() {
{
describe('NgModuleResolver', () => {
let resolver: NgModuleResolver;

View File

@ -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');

View File

@ -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',

View File

@ -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;

View File

@ -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

View File

@ -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', () => {

View File

@ -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