Skip to content

Commit 15c36eb

Browse files
committed
test: use the targets property in legacy cli e2e
1 parent 63b2b11 commit 15c36eb

31 files changed

+39
-39
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default function () {
9595
{ 'glob': 'output-asset.txt', 'output': 'output-folder' },
9696
{ 'glob': '**/*', 'input': 'node_modules/some-package/', 'output': 'package-folder' }
9797
];
98-
const appArchitect = workspaceJson.projects['test-project'].architect;
98+
const appArchitect = workspaceJson.projects['test-project'].targets;
9999
appArchitect.build.options.assets = assets;
100100
appArchitect.test.options.assets = assets;
101101
}))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default function () {
2929
})
3030
.then(() => appendToFile('src/main.ts', 'import \'./string-script.js\';'))
3131
.then(() => updateJsonFile('angular.json', configJson => {
32-
const appArchitect = configJson.projects['test-project'].architect;
32+
const appArchitect = configJson.projects['test-project'].targets;
3333
appArchitect.build.options.scripts = [
3434
{ input: 'src/string-script.js' },
3535
{ input: 'src/zstring-script.js' },

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function () {
1717
'src/pre-rename-lazy-style.css': '.pre-rename-lazy-style { color: red }'
1818
})
1919
.then(() => updateJsonFile('angular.json', workspaceJson => {
20-
const appArchitect = workspaceJson.projects['test-project'].architect;
20+
const appArchitect = workspaceJson.projects['test-project'].targets;
2121
appArchitect.build.options.styles = [
2222
{ input: 'src/string-style.css' },
2323
{ input: 'src/input-style.css' },

tests/legacy-cli/e2e/tests/build/build-app-shell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default function () {
2626

2727
return Promise.resolve()
2828
.then(() => updateJsonFile('angular.json', workspaceJson => {
29-
const appArchitect = workspaceJson.projects['test-project'].architect;
29+
const appArchitect = workspaceJson.projects['test-project'].targets;
3030
appArchitect['server'] = {
3131
builder: '@angular-devkit/build-angular:server',
3232
options: {

tests/legacy-cli/e2e/tests/build/bundle-budgets.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function () {
3535
if (cfg.expectation === 'error') {
3636
return () => {
3737
return updateJsonFile('angular.json', (json) => {
38-
json.projects['test-project'].architect.build.options.budgets = [cfg.budget];
38+
json.projects['test-project'].targets.build.options.budgets = [cfg.budget];
3939
})
4040
.then(() => expectToFail(() => ng('build', '--optimization')))
4141
.then(errorMessage => {
@@ -47,7 +47,7 @@ export default function () {
4747
} else if (cfg.expectation === 'warning') {
4848
return () => {
4949
return updateJsonFile('angular.json', (json) => {
50-
json.projects['test-project'].architect.build.options.budgets = [cfg.budget];
50+
json.projects['test-project'].targets.build.options.budgets = [cfg.budget];
5151
})
5252
.then(() => ng('build', '--optimization'))
5353
.then(({ stdout }) => {
@@ -59,7 +59,7 @@ export default function () {
5959
} else { // pass
6060
return () => {
6161
return updateJsonFile('angular.json', (json) => {
62-
json.projects['test-project'].architect.build.options.budgets = [cfg.budget];
62+
json.projects['test-project'].targets.build.options.budgets = [cfg.budget];
6363
})
6464
.then(() => ng('build', '--optimization'))
6565
.then(({ stdout }) => {

tests/legacy-cli/e2e/tests/build/dynamic-import.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default async function() {
88
// Add a lazy module
99
await ng('generate', 'module', 'lazy');
1010
await updateJsonFile('angular.json', workspaceJson => {
11-
const appArchitect = workspaceJson.projects['test-project'].architect;
11+
const appArchitect = workspaceJson.projects['test-project'].targets;
1212
appArchitect.build.options.lazyModules = [
1313
'src/app/lazy/lazy.module'
1414
];

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function() {
77
// Try a prod build.
88
return Promise.resolve()
99
.then(() => updateJsonFile('angular.json', configJson => {
10-
const appArchitect = configJson.projects['test-project'].architect;
10+
const appArchitect = configJson.projects['test-project'].targets;
1111
appArchitect.build.configurations['prod-env'] = {
1212
fileReplacements: [
1313
{

tests/legacy-cli/e2e/tests/build/output-dir.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function() {
1919
.then(() => expectFileToExist('./build-output/main.js'))
2020
.then(() => expectToFail(expectGitToBeClean))
2121
.then(() => updateJsonFile('angular.json', workspaceJson => {
22-
const appArchitect = workspaceJson.projects['test-project'].architect;
22+
const appArchitect = workspaceJson.projects['test-project'].targets;
2323
appArchitect.build.options.outputPath = 'config-build-output';
2424
}))
2525
.then(() => ng('build'))

tests/legacy-cli/e2e/tests/build/platform-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default function () {
3636
dependencies['@angular/platform-server'] = platformServerVersion;
3737
}))
3838
.then(() => updateJsonFile('angular.json', workspaceJson => {
39-
const appArchitect = workspaceJson.projects['test-project'].architect;
39+
const appArchitect = workspaceJson.projects['test-project'].targets;
4040
appArchitect['server'] = {
4141
builder: '@angular-devkit/build-angular:server',
4242
options: {

tests/legacy-cli/e2e/tests/build/service-worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default function() {
3232
// stuck to the first build done
3333
return silentNpm('remove', '@angular/service-worker')
3434
.then(() => silentNpm('install', '@angular/service-worker'))
35-
.then(() => ng('config', 'projects.test-project.architect.build.options.serviceWorker', 'true'))
35+
.then(() => ng('config', 'projects.test-project.targets.build.options.serviceWorker', 'true'))
3636
.then(() => writeFile('src/ngsw-config.json', JSON.stringify(MANIFEST, null, 2)))
3737
.then(() => ng('build', '--optimization'))
3838
.then(() => expectFileToExist(join(process.cwd(), 'dist')))

0 commit comments

Comments
 (0)