Skip to content

Commit 8e169b8

Browse files
filipesilvahansl
authored andcommitted
test: re-enable bundle budget test
1 parent ceb2588 commit 8e169b8

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ export default function () {
3434
const promiseFactories = budgetConfigs.map(cfg => {
3535
if (cfg.expectation === 'error') {
3636
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+
})
3840
.then(() => expectToFail(() => ng('build', '--optimization')))
3941
.then(errorMessage => {
4042
if (!/ERROR in budgets/.test(errorMessage)) {
@@ -44,7 +46,9 @@ export default function () {
4446
};
4547
} else if (cfg.expectation === 'warning') {
4648
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+
})
4852
.then(() => ng('build', '--optimization'))
4953
.then(({ stdout }) => {
5054
if (!/WARNING in budgets/.test(stdout)) {
@@ -54,7 +58,9 @@ export default function () {
5458
};
5559
} else { // pass
5660
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+
})
5864
.then(() => ng('build', '--optimization'))
5965
.then(({ stdout }) => {
6066
if (/(WARNING|ERROR)/.test(stdout)) {

tests/e2e_runner.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ const allTests = glob.sync(path.join(e2eRoot, testGlob), { nodir: true, ignore:
111111
// Replace windows slashes.
112112
.map(name => name.replace(/\\/g, '/'))
113113
.filter(name => !name.endsWith('/build-app-shell-with-schematic.ts'))
114-
.filter(name => !name.endsWith('/bundle-budgets.ts'))
115114
.filter(name => !name.endsWith('/new-minimal.ts'))
116115
// IS this test still valid? \/
117116
.filter(name => !name.endsWith('/module-id.ts'))

0 commit comments

Comments
 (0)