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

PR Close #36613
This commit is contained in:
Joey Perrott
2020-04-13 16:40:21 -07:00
committed by atscott
parent 5e80e7e216
commit 698b0288be
1160 changed files with 31667 additions and 24000 deletions

View File

@ -6,14 +6,14 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ElementFinder, by} from 'protractor';
import {by, ElementFinder} from 'protractor';
declare global {
namespace jasmine {
interface Matchers<T> {
toBeAHero(): Promise<void>;
toHaveName(exectedName: string): Promise<void>;
}
interface Matchers<T> {
toBeAHero(): Promise<void>;
toHaveName(exectedName: string): Promise<void>;
}
}
}
@ -22,43 +22,41 @@ const isTitleCased = (text: string) =>
export function addCustomMatchers() {
jasmine.addMatchers({
toBeAHero:
() => ({
compare(actualNg1Hero: ElementFinder | undefined) {
const getText = (selector: string) =>
actualNg1Hero !.element(by.css(selector)).getText();
const result = {
message: 'Expected undefined to be an `ng1Hero` ElementFinder.',
pass: !!actualNg1Hero &&
Promise.all(['.title', 'h2', 'p'].map(getText) as PromiseLike<string>[])
.then(([actualTitle, actualName, actualDescription]) => {
const pass = (actualTitle === 'Super Hero') && isTitleCased(actualName) &&
(actualDescription.length > 0);
toBeAHero: () => ({
compare(actualNg1Hero: ElementFinder|undefined) {
const getText = (selector: string) => actualNg1Hero!.element(by.css(selector)).getText();
const result = {
message: 'Expected undefined to be an `ng1Hero` ElementFinder.',
pass: !!actualNg1Hero &&
Promise.all(['.title', 'h2', 'p'].map(getText) as PromiseLike<string>[])
.then(([actualTitle, actualName, actualDescription]) => {
const pass = (actualTitle === 'Super Hero') && isTitleCased(actualName) &&
(actualDescription.length > 0);
const actualHero =
`Hero(${actualTitle}, ${actualName}, ${actualDescription})`;
result.message =
`Expected ${actualHero}'${pass ? ' not' : ''} to be a real hero.`;
const actualHero = `Hero(${actualTitle}, ${actualName}, ${actualDescription})`;
result.message =
`Expected ${actualHero}'${pass ? ' not' : ''} to be a real hero.`;
return pass;
})
};
return result;
}
}),
toHaveName: () => ({
compare(actualNg1Hero: ElementFinder | undefined, expectedName: string) {
const result = {
message: 'Expected undefined to be an `ng1Hero` ElementFinder.',
pass: !!actualNg1Hero && actualNg1Hero.element(by.css('h2')).getText().then(actualName => {
return pass;
})
};
return result;
}
}),
toHaveName: () => ({
compare(actualNg1Hero: ElementFinder|undefined, expectedName: string) {
const result = {
message: 'Expected undefined to be an `ng1Hero` ElementFinder.',
pass:
!!actualNg1Hero && actualNg1Hero.element(by.css('h2')).getText().then(actualName => {
const pass = actualName === expectedName;
result.message =
`Expected Hero(${actualName})${pass ? ' not' : ''} to have name '${expectedName}'.`;
result.message = `Expected Hero(${actualName})${pass ? ' not' : ''} to have name '${
expectedName}'.`;
return pass;
})
};
return result;
}
}),
};
return result;
}
}),
} as any);
}

View File

@ -6,7 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ElementArrayFinder, ElementFinder, browser, by, element} from 'protractor';
import {browser, by, element, ElementArrayFinder, ElementFinder} from 'protractor';
import {verifyNoBrowserErrors} from '../../../../../test-utils';
import {addCustomMatchers} from './e2e_util';