Skip to content

Commit 55b833c

Browse files
alan-agius4filipesilva
authored andcommitted
test(@angular/cli): change tests to reflect prod mode by default changes
1 parent 1de6d71 commit 55b833c

File tree

94 files changed

+194
-186
lines changed

Some content is hidden

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

94 files changed

+194
-186
lines changed

tests/legacy-cli/e2e/setup/500-create-project.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ export default async function() {
5050
// In VE non prod builds are non AOT by default
5151
await updateJsonFile('angular.json', config => {
5252
const build = config.projects['test-project'].architect.build;
53-
build.options.aot = false;
54-
build.configurations.production.aot = true;
53+
build.options.aot = true;
54+
build.configurations.development.aot = false;
5555
});
5656
}
5757
}

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

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

55
export default async function () {
6-
await ng('build', '--aot=true');
6+
await ng('build', '--aot=true', '--configuration=development');
77

88
if (getGlobalVariable('argv')['ve']) {
99
await expectFileToMatch('dist/test-project/main.js',

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

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

55
export default async function() {
66
// Development build
7-
await ng('build');
7+
await ng('build', '--configuration=development');
88
await expectFileToMatch('dist/test-project/index.html', 'main.js');
99

1010
// Named Development build
11-
await ng('build', 'test-project');
12-
await ng('build', 'test-project', '--no-progress');
13-
await ng('build', '--no-progress', 'test-project');
11+
await ng('build', 'test-project', '--configuration=development');
12+
await ng('build', '--configuration=development', 'test-project', '--no-progress');
13+
await ng('build', '--configuration=development', '--no-progress', 'test-project');
1414

1515
// Enable Differential loading to run both size checks
1616
await replaceInFile(
@@ -19,7 +19,7 @@ export default async function() {
1919
'IE 11',
2020
);
2121
// Production build
22-
const { stderr: stderrProgress, stdout } = await ng('build', '--prod', '--progress');
22+
const { stderr: stderrProgress, stdout } = await ng('build', '--progress');
2323
await expectFileToMatch('dist/test-project/index.html', /main-es5\.[a-zA-Z0-9]{20}\.js/);
2424
await expectFileToMatch('dist/test-project/index.html', /main-es2015\.[a-zA-Z0-9]{20}\.js/);
2525

@@ -44,7 +44,7 @@ export default async function() {
4444
}
4545
}
4646

47-
const { stderr: stderrNoProgress } = await ng('build', '--prod', '--no-progress');
47+
const { stderr: stderrNoProgress } = await ng('build', '--no-progress');
4848
for (const log of logs) {
4949
if (stderrNoProgress.includes(log)) {
5050
throw new Error(`Expected stderr not to contain '${log}' but it did.\n${stderrProgress}`);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function () {
1212
.then(() => expectToFail(() => ng('e2e', 'test-project', '--devServerTarget=')))
1313
// These should work.
1414
.then(() => ng('e2e', 'test-project'))
15-
.then(() => ng('e2e', 'test-project', '--devServerTarget=test-project:serve:production'))
15+
.then(() => ng('e2e', 'test-project', '--devServerTarget=test-project:serve'))
1616
// Should accept different config file
1717
.then(() => moveFile('./e2e/protractor.conf.js',
1818
'./e2e/renamed-protractor.conf.js'))

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default async function () {
88
await updateJsonFile('angular.json', configJson => {
99
const appArchitect = configJson.projects['test-project'].architect;
1010
appArchitect.build.configurations['prod-env'] = {
11+
...appArchitect.build.configurations['development'],
1112
fileReplacements: [
1213
{
1314
src: 'src/environments/environment.ts',

tests/legacy-cli/e2e/tests/basic/ngcc-es2015-only.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default async function() {
1313
// Don't run this test for VE jobs. It only applies to Ivy.
1414
return;
1515
}
16-
const { stderr, stdout } = await ng('build', '--prod');
16+
const { stderr, stdout } = await ng('build');
1717

1818
if (stdout.includes('as esm5') || stderr.includes('as esm5')) {
1919
throw new Error('ngcc should not process ES5 during differential loading builds.');

tests/legacy-cli/e2e/tests/basic/scripts-array.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default async function () {
4141
];
4242
});
4343

44-
await ng('build', '--extract-css');
44+
await ng('build', '--extract-css', '--configuration=development');
4545

4646
// files were created successfully
4747
await expectFileToMatch('dist/test-project/scripts.js', 'string-script');

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default async function () {
3131
await ng('generate', 'module', 'lazy', '--route=lazy', '--module=app.module');
3232

3333
// Build without hashing and with named chunks to keep have consistent file names.
34-
await ng('build', '--prod', '--output-hashing=none', '--named-chunks=true');
34+
await ng('build', '--output-hashing=none', '--named-chunks=true');
3535

3636
// Upload to the store_artifacts dir listed in .circleci/config.yml
3737
await moveDirectory('dist', '/tmp/dist');

tests/legacy-cli/e2e/tests/basic/styles-array.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default async function() {
2727
];
2828
});
2929

30-
await ng('build', '--extract-css');
30+
await ng('build', '--extract-css', '--configuration=development');
3131

3232
await expectFileToMatch('dist/test-project/styles.css', '.string-style');
3333
await expectFileToMatch('dist/test-project/styles.css', '.input-style');

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ export default async function() {
1515
json['compilerOptions'].allowJs = true;
1616
});
1717

18-
await ng('build');
19-
await ng('build', '--aot');
18+
await ng('build', '--configuration=development');
19+
await ng('build', '--aot', '--configuration=development');
2020
}

0 commit comments

Comments
 (0)