@@ -34,7 +34,9 @@ export default function () {
34
34
const promiseFactories = budgetConfigs . map ( cfg => {
35
35
if ( cfg . expectation === 'error' ) {
36
36
return ( ) => {
37
- return updateJsonFile ( 'angular.json' , ( json ) => { json . apps [ 0 ] . budgets = [ cfg . budget ] ; } )
37
+ return updateJsonFile ( 'angular.json' , ( json ) => {
38
+ json . projects [ 'test-project' ] . architect . build . options . budgets = [ cfg . budget ] ;
39
+ } )
38
40
. then ( ( ) => expectToFail ( ( ) => ng ( 'build' , '--optimization' ) ) )
39
41
. then ( errorMessage => {
40
42
if ( ! / E R R O R i n b u d g e t s / . test ( errorMessage ) ) {
@@ -44,7 +46,9 @@ export default function () {
44
46
} ;
45
47
} else if ( cfg . expectation === 'warning' ) {
46
48
return ( ) => {
47
- return updateJsonFile ( 'angular.json' , ( json ) => { json . apps [ 0 ] . budgets = [ cfg . budget ] ; } )
49
+ return updateJsonFile ( 'angular.json' , ( json ) => {
50
+ json . projects [ 'test-project' ] . architect . build . options . budgets = [ cfg . budget ] ;
51
+ } )
48
52
. then ( ( ) => ng ( 'build' , '--optimization' ) )
49
53
. then ( ( { stdout } ) => {
50
54
if ( ! / W A R N I N G i n b u d g e t s / . test ( stdout ) ) {
@@ -54,7 +58,9 @@ export default function () {
54
58
} ;
55
59
} else { // pass
56
60
return ( ) => {
57
- return updateJsonFile ( 'angular.json' , ( json ) => { json . apps [ 0 ] . budgets = [ cfg . budget ] ; } )
61
+ return updateJsonFile ( 'angular.json' , ( json ) => {
62
+ json . projects [ 'test-project' ] . architect . build . options . budgets = [ cfg . budget ] ;
63
+ } )
58
64
. then ( ( ) => ng ( 'build' , '--optimization' ) )
59
65
. then ( ( { stdout } ) => {
60
66
if ( / ( W A R N I N G | E R R O R ) / . test ( stdout ) ) {
0 commit comments