Skip to content

Commit 2fa0691

Browse files
filipesilvaZhicheng Wang
authored and
Zhicheng Wang
committed
test: auto-add --no-progress to ng helper
Close angular#4695
1 parent cec9b68 commit 2fa0691

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

tests/e2e/tests/i18n/extract-default.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function() {
1111
.then(() => writeFile(
1212
join('src/app/i18n-test', 'i18n-test.component.html'),
1313
'<p i18n>Hello world</p>'))
14-
.then(() => ng('xi18n', '--no-progress'))
14+
.then(() => ng('xi18n'))
1515
.then(() => expectFileToExist(join('src', 'messages.xlf')))
1616
.then(() => expectFileToMatch(join('src', 'messages.xlf'), /Hello world/));
1717
}

tests/e2e/tests/i18n/extract-output.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function() {
1111
.then(() => writeFile(
1212
join('src/app/i18n-test', 'i18n-test.component.html'),
1313
'<p i18n>Hello world</p>'))
14-
.then(() => ng('xi18n', '--no-progress', '--output-path', 'src/locale'))
14+
.then(() => ng('xi18n', '--output-path', 'src/locale'))
1515
.then(() => expectFileToExist(join('src', 'locale', 'messages.xlf')))
1616
.then(() => expectFileToMatch(join('src', 'locale', 'messages.xlf'), /Hello world/));
1717
}

tests/e2e/tests/i18n/extract-xmb.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function() {
1111
.then(() => writeFile(
1212
join('src/app/i18n-test', 'i18n-test.component.html'),
1313
'<p i18n>Hello world</p>'))
14-
.then(() => ng('xi18n', '--no-progress', '--i18n-format', 'xmb'))
14+
.then(() => ng('xi18n', '--i18n-format', 'xmb'))
1515
.then(() => expectFileToExist(join('src', 'messages.xmb')))
1616
.then(() => expectFileToMatch(join('src', 'messages.xmb'), /Hello world/));
1717
}

tests/e2e/tests/misc/minimal-config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function () {
1515
}],
1616
e2e: { protractor: { config: './protractor.conf.js' } }
1717
})))
18-
.then(() => ng('e2e', '--no-progress'))
18+
.then(() => ng('e2e'))
1919
.then(() => writeMultipleFiles({
2020
'./src/script.js': `
2121
document.querySelector('app-root').innerHTML = '<h1>app works!</h1>';
@@ -40,5 +40,5 @@ export default function () {
4040
e2e: { protractor: { config: './protractor.conf.js' } }
4141
}),
4242
}))
43-
.then(() => ng('e2e', '--no-progress'));
43+
.then(() => ng('e2e'));
4444
}

tests/e2e/tests/test/e2e.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ export default function () {
2121
// Should fail without serving
2222
.then(() => expectToFail(() => ng('e2e', '--no-serve')))
2323
// These should work.
24-
.then(() => ng('e2e', '--no-progress'))
25-
.then(() => ng('e2e', '--prod', '--no-progress'))
24+
.then(() => ng('e2e'))
25+
.then(() => ng('e2e', '--prod'))
2626
// Should use port in baseUrl
27-
.then(() => ng('e2e', '--port', '4400', '--no-progress'))
27+
.then(() => ng('e2e', '--port', '4400'))
2828
// Should accept different config file
2929
.then(() => moveFile('./protractor.conf.js', './renamed-protractor.conf.js'))
30-
.then(() => ng('e2e', '--config', './renamed-protractor.conf.js', '--no-progress'))
30+
.then(() => ng('e2e', '--config', './renamed-protractor.conf.js'))
3131
.then(() => moveFile('./renamed-protractor.conf.js', './protractor.conf.js'))
3232
// Should accept different multiple spec files
3333
.then(() => moveFile('./e2e/app.e2e-spec.ts', './e2e/renamed-app.e2e-spec.ts'))
3434
.then(() => copyFile('./e2e/renamed-app.e2e-spec.ts', './e2e/another-app.e2e-spec.ts'))
3535
.then(() => ng('e2e', '--specs', './e2e/renamed-app.e2e-spec.ts',
36-
'--specs', './e2e/another-app.e2e-spec.ts', '--no-progress'))
36+
'--specs', './e2e/another-app.e2e-spec.ts'))
3737
// Should start up Element Explorer
38-
.then(() => execAndWaitForOutputToMatch('ng', ['e2e', '--element-explorer', '--no-progress'],
38+
.then(() => execAndWaitForOutputToMatch('ng', ['e2e', '--element-explorer'],
3939
/Element Explorer/))
4040
.then(() => killAllProcesses(), (err: any) => {
4141
killAllProcesses();

tests/e2e/utils/process.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ export function silentExecAndWaitForOutputToMatch(cmd: string, args: string[], m
135135
}
136136

137137
export function ng(...args: string[]) {
138-
if (args[0] == 'build' || args[0] == 'serve' || args[0] == 'test') {
138+
// Auto-add --no-progress to commands that build the app, otherwise we get thousands of lines.
139+
if (['build', 'serve', 'test', 'e2e', 'xi18n'].indexOf(args[0]) != -1) {
139140
return silentNg(...args, '--no-progress');
140141
} else {
141142
return _exec({}, 'ng', args);

0 commit comments

Comments
 (0)