Skip to content

Commit 67ca0fa

Browse files
filipesilvaBrocco
authored andcommitted
ci: use silentNpm throughout
1 parent abb168e commit 67ca0fa

File tree

6 files changed

+14
-18
lines changed

6 files changed

+14
-18
lines changed

tests/e2e/tests/build/aot/angular-compiler.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { ng, npm } from '../../../utils/process';
1+
import { ng, silentNpm } from '../../../utils/process';
22
import { updateJsonFile } from '../../../utils/project';
33
import { expectFileToMatch, rimraf, moveFile } from '../../../utils/fs';
4-
import { expectToFail } from '../../../utils/utils';
54
import { getGlobalVariable } from '../../../utils/env';
65
import { expectToFail } from '../../../utils/utils';
76

@@ -32,10 +31,7 @@ export default function () {
3231
devDependencies['@angular/language-service'] = '5.0.0-beta.6';
3332
devDependencies['typescript'] = '2.4.2';
3433
}))
35-
.then(() => npm('install'))
36-
.then(() => ng('build'))
37-
.then(() => expectToFail(() => expectFileToMatch('dist/main.bundle.js',
38-
/bootstrapModuleFactory.*\/\* AppModuleNgFactory \*\//)))
34+
.then(() => silentNpm('install'))
3935
.then(() => ng('build', '--aot'))
4036
.then(() => expectFileToMatch('dist/main.bundle.js',
4137
/bootstrapModuleFactory.*\/\* AppModuleNgFactory \*\//))

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {join} from 'path';
22
import {getGlobalVariable} from '../../utils/env';
33
import {expectFileToExist, expectFileToMatch, writeFile, moveFile} from '../../utils/fs';
4-
import {ng, npm} from '../../utils/process';
4+
import {ng, silentNpm} from '../../utils/process';
55

66
export default function() {
77
// Skip this in ejected tests.
@@ -13,7 +13,7 @@ export default function() {
1313

1414
// Can't use the `ng` helper because somewhere the environment gets
1515
// stuck to the first build done
16-
return npm('install', '@angular/service-worker')
16+
return silentNpm('install', '@angular/service-worker')
1717
.then(() => ng('set', 'apps.0.serviceWorker=true'))
1818
.then(() => ng('build', '--prod'))
1919
.then(() => expectFileToExist(join(process.cwd(), 'dist')))

tests/e2e/tests/misc/common-async.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {readdirSync} from 'fs';
22
import {oneLine} from 'common-tags';
33

4-
import {ng, npm} from '../../utils/process';
4+
import {ng, silentNpm} from '../../utils/process';
55
import {addImportToModule} from '../../utils/ast';
66
import {appendToFile, expectFileToExist} from '../../utils/fs';
77
import {expectToFail} from '../../utils/utils';
@@ -26,7 +26,7 @@ export default function() {
2626
}
2727
oldNumberOfFiles = currentNumberOfDistFiles;
2828
})
29-
.then(() => npm('install', 'moment'))
29+
.then(() => silentNpm('install', 'moment'))
3030
.then(() => appendToFile('src/app/lazy-a/lazy-a.module.ts', `
3131
import * as moment from 'moment';
3232
console.log(moment);

tests/e2e/tests/misc/lazy-module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {readdirSync} from 'fs';
22
import {oneLine} from 'common-tags';
33

4-
import {ng, npm} from '../../utils/process';
4+
import {ng, silentNpm} from '../../utils/process';
55
import {addImportToModule} from '../../utils/ast';
66
import {appendToFile, writeFile} from '../../utils/fs';
77

@@ -55,7 +55,7 @@ export default function() {
5555
oldNumberOfFiles = currentNumberOfDistFiles;
5656
})
5757
// verify 'import *' syntax doesn't break lazy modules
58-
.then(() => npm('install', 'moment'))
58+
.then(() => silentNpm('install', 'moment'))
5959
.then(() => appendToFile('src/app/app.component.ts', `
6060
import * as moment from 'moment';
6161
console.log(moment);

tests/e2e/tests/misc/typescript-warning.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ng, npm } from '../../utils/process';
1+
import { ng, silentNpm } from '../../utils/process';
22
import { getGlobalVariable } from '../../utils/env';
33

44

@@ -15,15 +15,15 @@ export default function () {
1515
}
1616

1717
return Promise.resolve()
18-
.then(() => npm('uninstall', 'typescript', '--no-save'))
18+
.then(() => silentNpm('uninstall', 'typescript', '--no-save'))
1919
.then(() => ng('build'))
2020
.catch((err) => {
2121
if (!err.message.match('Versions of @angular/compiler-cli and typescript could not')) {
2222
throw new Error('Expected to have missing dependency error in output.');
2323
}
2424
})
2525
// Warning should show.
26-
.then(() => npm('install', `typescript@${unsupportedTsVersion}`, '--no-save'))
26+
.then(() => silentNpm('install', `typescript@${unsupportedTsVersion}`, '--no-save'))
2727
.then(() => ng('build'))
2828
.then((output) => {
2929
if (!output.stdout.match('Using this version can result in undefined behaviour')) {
@@ -49,6 +49,6 @@ export default function () {
4949
})
5050
.then(() => ng('set', 'warnings.typescriptMismatch=true'))
5151
// Cleanup
52-
.then(() => npm('install'));
52+
.then(() => silentNpm('install'));
5353
}
5454

tests/e2e/tests/third-party/bootstrap.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import {npm, ng} from '../../utils/process';
1+
import {silentNpm, ng} from '../../utils/process';
22
import {updateJsonFile} from '../../utils/project';
33
import {expectFileToMatch} from '../../utils/fs';
44
import {oneLineTrim} from 'common-tags';
55

66

77
export default function() {
88
return Promise.resolve()
9-
.then(() => npm('install', 'bootstrap@next'))
9+
.then(() => silentNpm('install', 'bootstrap@next'))
1010
.then(() => updateJsonFile('.angular-cli.json', configJson => {
1111
const app = configJson['apps'][0];
1212
app['styles'].push('../node_modules/bootstrap/dist/css/bootstrap.css');

0 commit comments

Comments
 (0)