build: reformat repo to new clang@1.4.0 (#36628)

PR Close #36628
This commit is contained in:
Joey Perrott
2020-04-13 17:43:52 -07:00
committed by atscott
parent 4b3f9ac739
commit 26f49151e7
1163 changed files with 31727 additions and 24036 deletions

View File

@ -25,9 +25,9 @@ class SomeMetadata implements SomeMetadataType {
arrayProp: any[];
constructor(options: SomeMetadataType) {
this.plainProp = options.plainProp !;
this._getterProp = options.getterProp !;
this.arrayProp = options.arrayProp !;
this.plainProp = options.plainProp!;
this._getterProp = options.getterProp!;
this.arrayProp = options.arrayProp!;
Object.defineProperty(this, 'getterProp', {
enumerable: true, // getters are non-enumerable by default in es2015
get: () => this._getterProp,
@ -45,7 +45,7 @@ class OtherMetadata extends SomeMetadata implements OtherMetadataType {
arrayProp: options.arrayProp
});
this.otherPlainProp = options.otherPlainProp !;
this.otherPlainProp = options.otherPlainProp!;
}
}
@ -53,7 +53,9 @@ class OtherMetadata extends SomeMetadata implements OtherMetadataType {
describe('metadata overrider', () => {
let overrider: MetadataOverrider;
beforeEach(() => { overrider = new MetadataOverrider(); });
beforeEach(() => {
overrider = new MetadataOverrider();
});
it('should return a new instance with the same values', () => {
const oldInstance = new SomeMetadata({plainProp: 'somePlainProp', getterProp: 'someInput'});
@ -130,7 +132,6 @@ class OtherMetadata extends SomeMetadata implements OtherMetadataType {
const instance3 =
overrider.overrideMetadata(SomeMetadata, instance2, {remove: {arrayProp: [Class3]}});
expect(instance3).toEqual(new SomeMetadata({arrayProp: [Class2]}));
});
});
@ -149,7 +150,6 @@ class OtherMetadata extends SomeMetadata implements OtherMetadataType {
otherPlainProp: 'newOtherProp'
}));
});
});
});
}

View File

@ -8,7 +8,7 @@
import {ResourceLoader, UrlResolver} from '@angular/compiler';
import {Component} from '@angular/core';
import {TestBed, async, fakeAsync, tick} from '@angular/core/testing';
import {async, fakeAsync, TestBed, tick} from '@angular/core/testing';
import {CachedResourceLoader} from '@angular/platform-browser-dynamic/src/resource_loader/resource_loader_cache';
import {setTemplateCache} from '@angular/platform-browser-dynamic/test/resource_loader/resource_loader_cache_setter';
import {expect} from '@angular/platform-browser/testing/src/matchers';
@ -31,7 +31,9 @@ if (isBrowser) {
it('should resolve the Promise with the cached file content on success', async(() => {
resourceLoader = createCachedResourceLoader();
resourceLoader.get('test.html').then((text) => { expect(text).toBe('<div>Hello</div>'); });
resourceLoader.get('test.html').then((text) => {
expect(text).toBe('<div>Hello</div>');
});
}));
it('should reject the Promise on failure', async(() => {

View File

@ -22,7 +22,9 @@ if (isBrowser) {
const url200 = '/base/angular/packages/platform-browser/test/browser/static_assets/200.html';
const url404 = '/bad/path/404.html';
beforeEach(() => { resourceLoader = new ResourceLoaderImpl(); });
beforeEach(() => {
resourceLoader = new ResourceLoaderImpl();
});
it('should resolve the Promise with the file content on success',
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {

View File

@ -8,8 +8,7 @@
import {ResourceLoader} from '@angular/compiler';
import {Compiler, Component, NgModule} from '@angular/core';
import {TestBed, async, fakeAsync, inject, tick} from '@angular/core/testing';
import {async, fakeAsync, inject, TestBed, tick} from '@angular/core/testing';
import {ResourceLoaderImpl} from '@angular/platform-browser-dynamic/src/resource_loader/resource_loader_impl';
@ -17,10 +16,15 @@ import {ResourceLoaderImpl} from '@angular/platform-browser-dynamic/src/resource
// Components for the tests.
class FancyService {
value: string = 'real value';
getAsyncValue() { return Promise.resolve('async value'); }
getAsyncValue() {
return Promise.resolve('async value');
}
getTimeoutValue() {
return new Promise(
(resolve, reject) => { setTimeout(() => { resolve('timeout value'); }, 10); });
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve('timeout value');
}, 10);
});
}
}
@ -42,15 +46,21 @@ if (isBrowser) {
describe('using the async helper', () => {
let actuallyDone: boolean;
beforeEach(() => { actuallyDone = false; });
beforeEach(() => {
actuallyDone = false;
});
afterEach(() => { expect(actuallyDone).toEqual(true); });
afterEach(() => {
expect(actuallyDone).toEqual(true);
});
it('should run async tests with ResourceLoaders', async(() => {
const resourceLoader = new ResourceLoaderImpl();
resourceLoader
.get('/base/angular/packages/platform-browser/test/static_assets/test.html')
.then(() => { actuallyDone = true; });
.then(() => {
actuallyDone = true;
});
}),
10000); // Long timeout here because this test makes an actual ResourceLoader.
});
@ -70,7 +80,9 @@ if (isBrowser) {
it('should allow the use of fakeAsync',
fakeAsync(inject([FancyService], (service: any /** TODO #9100 */) => {
let value: any /** TODO #9100 */;
service.getAsyncValue().then(function(val: any /** TODO #9100 */) { value = val; });
service.getAsyncValue().then(function(val: any /** TODO #9100 */) {
value = val;
});
tick();
expect(value).toEqual('async value');
})));
@ -113,7 +125,9 @@ if (isBrowser) {
return promise;
};
const restoreJasmineIt = () => { jasmine.getEnv().it = originalJasmineIt; };
const restoreJasmineIt = () => {
jasmine.getEnv().it = originalJasmineIt;
};
it('should fail when an ResourceLoader fails', done => {
const itPromise = patchJasmineIt();
@ -124,7 +138,9 @@ if (isBrowser) {
}));
itPromise.then(
() => { done.fail('Expected test to fail, but it did not'); },
() => {
done.fail('Expected test to fail, but it did not');
},
(err: any) => {
expect(err.message)
.toEqual('Uncaught (in promise): Failed to load non-existent.html');