Skip to content

Commit

Permalink
test: re-enable bundle budget test
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva authored and hansl committed Mar 29, 2018
1 parent ceb2588 commit 8e169b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 9 additions & 3 deletions tests/e2e/tests/build/bundle-budgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export default function () {
const promiseFactories = budgetConfigs.map(cfg => {
if (cfg.expectation === 'error') {
return () => {
return updateJsonFile('angular.json', (json) => { json.apps[0].budgets = [cfg.budget]; })
return updateJsonFile('angular.json', (json) => {
json.projects['test-project'].architect.build.options.budgets = [cfg.budget];
})
.then(() => expectToFail(() => ng('build', '--optimization')))
.then(errorMessage => {
if (!/ERROR in budgets/.test(errorMessage)) {
Expand All @@ -44,7 +46,9 @@ export default function () {
};
} else if (cfg.expectation === 'warning') {
return () => {
return updateJsonFile('angular.json', (json) => { json.apps[0].budgets = [cfg.budget]; })
return updateJsonFile('angular.json', (json) => {
json.projects['test-project'].architect.build.options.budgets = [cfg.budget];
})
.then(() => ng('build', '--optimization'))
.then(({ stdout }) => {
if (!/WARNING in budgets/.test(stdout)) {
Expand All @@ -54,7 +58,9 @@ export default function () {
};
} else { // pass
return () => {
return updateJsonFile('angular.json', (json) => { json.apps[0].budgets = [cfg.budget]; })
return updateJsonFile('angular.json', (json) => {
json.projects['test-project'].architect.build.options.budgets = [cfg.budget];
})
.then(() => ng('build', '--optimization'))
.then(({ stdout }) => {
if (/(WARNING|ERROR)/.test(stdout)) {
Expand Down
1 change: 0 additions & 1 deletion tests/e2e_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ const allTests = glob.sync(path.join(e2eRoot, testGlob), { nodir: true, ignore:
// Replace windows slashes.
.map(name => name.replace(/\\/g, '/'))
.filter(name => !name.endsWith('/build-app-shell-with-schematic.ts'))
.filter(name => !name.endsWith('/bundle-budgets.ts'))
.filter(name => !name.endsWith('/new-minimal.ts'))
// IS this test still valid? \/
.filter(name => !name.endsWith('/module-id.ts'))
Expand Down

0 comments on commit 8e169b8

Please sign in to comment.