Skip to content

Commit e97fd3a

Browse files
jbedarddgp1130
authored andcommitted
build: run prettier on legacy-cli e2e files
(cherry picked from commit 8bdf1a8)
1 parent 644f86d commit e97fd3a

File tree

123 files changed

+1380
-1096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+1380
-1096
lines changed

tests/legacy-cli/e2e/setup/100-global-cli.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getGlobalVariable } from '../utils/env';
22
import { exec, silentNpm } from '../utils/process';
33

4-
export default async function() {
4+
export default async function () {
55
const argv = getGlobalVariable('argv');
66
if (argv.noglobal) {
77
return;
@@ -10,12 +10,7 @@ export default async function() {
1010
const testRegistry = getGlobalVariable('package-registry');
1111

1212
// Install global Angular CLI.
13-
await silentNpm(
14-
'install',
15-
'--global',
16-
'@angular/cli',
17-
`--registry=${testRegistry}`,
18-
);
13+
await silentNpm('install', '--global', '@angular/cli', `--registry=${testRegistry}`);
1914

2015
try {
2116
await exec(process.platform.startsWith('win') ? 'where' : 'which', 'ng');

tests/legacy-cli/e2e/setup/200-create-tmp-dir.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { tmpdir } from 'os';
33
import { dirname, join } from 'path';
44
import { getGlobalVariable, setGlobalVariable } from '../utils/env';
55

6-
export default function() {
6+
export default function () {
77
const argv = getGlobalVariable('argv');
88

99
// Get to a temporary directory.

tests/legacy-cli/e2e/setup/300-log-environment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { ng, node, npm } from '../utils/process';
22

3-
export default async function() {
3+
export default async function () {
44
console.log('Environment:');
55

6-
Object.keys(process.env).forEach(envName => {
6+
Object.keys(process.env).forEach((envName) => {
77
// CI Logs should not contain environment variables that are considered secret
88
const lowerName = envName.toLowerCase();
99
if (lowerName.includes('key') || lowerName.includes('secret')) {

tests/legacy-cli/e2e/tests/basic/aot.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { ng } from '../../utils/process';
33

44
export default async function () {
55
await ng('build', '--aot=true', '--configuration=development');
6-
await expectFileToMatch('dist/test-project/main.js',
7-
/platformBrowser.*bootstrapModule.*AppModule/);
6+
await expectFileToMatch(
7+
'dist/test-project/main.js',
8+
/platformBrowser.*bootstrapModule.*AppModule/,
9+
);
810
}

tests/legacy-cli/e2e/tests/basic/environment.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ import { expectFileToMatch } from '../../utils/fs';
22
import { ng } from '../../utils/process';
33
import { updateJsonFile } from '../../utils/project';
44

5-
65
export default async function () {
76
// Try a prod build.
8-
await updateJsonFile('angular.json', configJson => {
7+
await updateJsonFile('angular.json', (configJson) => {
98
const appArchitect = configJson.projects['test-project'].architect;
109
appArchitect.build.configurations['prod-env'] = {
1110
...appArchitect.build.configurations['development'],

tests/legacy-cli/e2e/tests/basic/in-project-logic.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ import { writeFile, deleteFile } from '../../utils/fs';
44
import { ng } from '../../utils/process';
55
import { expectToFail } from '../../utils/utils';
66

7-
8-
export default function() {
7+
export default function () {
98
const homedir = os.homedir();
109
const globalConfigPath = join(homedir, '.angular-config.json');
11-
return Promise.resolve()
12-
.then(() => writeFile(globalConfigPath, '{"version":1}'))
13-
.then(() => process.chdir(homedir))
14-
.then(() => ng('new', 'proj-name', '--dry-run'))
15-
.then(() => deleteFile(globalConfigPath))
16-
// Test that we cannot create a project inside another project.
17-
.then(() => writeFile(join(homedir, '.angular.json'), '{"version":1}'))
18-
.then(() => expectToFail(() => ng('new', 'proj-name', '--dry-run')))
19-
.then(() => deleteFile(join(homedir, '.angular.json')));
10+
return (
11+
Promise.resolve()
12+
.then(() => writeFile(globalConfigPath, '{"version":1}'))
13+
.then(() => process.chdir(homedir))
14+
.then(() => ng('new', 'proj-name', '--dry-run'))
15+
.then(() => deleteFile(globalConfigPath))
16+
// Test that we cannot create a project inside another project.
17+
.then(() => writeFile(join(homedir, '.angular.json'), '{"version":1}'))
18+
.then(() => expectToFail(() => ng('new', 'proj-name', '--dry-run')))
19+
.then(() => deleteFile(join(homedir, '.angular.json')))
20+
);
2021
}

tests/legacy-cli/e2e/tests/basic/size-tracking.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
import { appendToFile, moveDirectory, prependToFile, replaceInFile, writeFile } from '../../utils/fs';
1+
import {
2+
appendToFile,
3+
moveDirectory,
4+
prependToFile,
5+
replaceInFile,
6+
writeFile,
7+
} from '../../utils/fs';
28
import { ng } from '../../utils/process';
39

4-
510
export default async function () {
611
// Store the production build for artifact storage on CircleCI
712
if (process.env['CIRCLECI']) {
8-
913
// Add initial app routing.
1014
// This is done automatically on a new app with --routing but must be done manually on
1115
// existing apps.
1216
const appRoutingModulePath = 'src/app/app-routing.module.ts';
13-
await writeFile(appRoutingModulePath, `
17+
await writeFile(
18+
appRoutingModulePath,
19+
`
1420
import { NgModule } from '@angular/core';
1521
import { Routes, RouterModule } from '@angular/router';
1622
@@ -21,9 +27,12 @@ export default async function () {
2127
exports: [RouterModule]
2228
})
2329
export class AppRoutingModule { }
24-
`);
25-
await prependToFile('src/app/app.module.ts',
26-
`import { AppRoutingModule } from './app-routing.module';`);
30+
`,
31+
);
32+
await prependToFile(
33+
'src/app/app.module.ts',
34+
`import { AppRoutingModule } from './app-routing.module';`,
35+
);
2736
await replaceInFile('src/app/app.module.ts', `imports: [`, `imports: [ AppRoutingModule,`);
2837
await appendToFile('src/app/app.component.html', '<router-outlet></router-outlet>');
2938

tests/legacy-cli/e2e/tests/build/allow-js.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@ import { ng } from '../../utils/process';
22
import { updateTsConfig } from '../../utils/project';
33
import { appendToFile, writeFile } from '../../utils/fs';
44

5-
export default async function() {
5+
export default async function () {
66
// TODO(architect): Delete this test. It is now in devkit/build-angular.
77

88
await writeFile('src/my-js-file.js', 'console.log(1); export const a = 2;');
9-
await appendToFile('src/main.ts', `
9+
await appendToFile(
10+
'src/main.ts',
11+
`
1012
import { a } from './my-js-file';
1113
console.log(a);
12-
`);
14+
`,
15+
);
1316

14-
await updateTsConfig(json => {
17+
await updateTsConfig((json) => {
1518
json['compilerOptions'].allowJs = true;
1619
});
1720

tests/legacy-cli/e2e/tests/build/assets.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ export default async function () {
1616
await expectToFail(() => expectFileToExist('dist/test-project/assets/.gitkeep'));
1717

1818
// Ensure `followSymlinks` option follows symlinks
19-
await updateJsonFile('angular.json', workspaceJson => {
19+
await updateJsonFile('angular.json', (workspaceJson) => {
2020
const appArchitect = workspaceJson.projects['test-project'].architect;
21-
appArchitect['build'].options.assets = [{ glob: '**/*', input: 'src/assets', output: 'assets', followSymlinks: true }];
21+
appArchitect['build'].options.assets = [
22+
{ glob: '**/*', input: 'src/assets', output: 'assets', followSymlinks: true },
23+
];
2224
});
2325
fs.mkdirSync('dirToSymlink/subdir1', { recursive: true });
2426
fs.mkdirSync('dirToSymlink/subdir2/subsubdir1', { recursive: true });

tests/legacy-cli/e2e/tests/build/barrel-file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { replaceInFile, writeFile } from '../../utils/fs';
22
import { ng } from '../../utils/process';
33

4-
export default async function() {
4+
export default async function () {
55
await writeFile('src/app/index.ts', `export { AppModule } from './app.module';`);
66
await replaceInFile('src/main.ts', './app/app.module', './app');
77
await ng('build', '--configuration=development');

0 commit comments

Comments
 (0)