Skip to content

Commit 0a08b95

Browse files
filipesilvaBrocco
authored andcommitted
test: replace silent exec with just exec
This will make the tests more verbose, but also easier to see the steps previous to the ones that error out. Should be merged with #6985 to reduce some of the spam.
1 parent f2e2fe5 commit 0a08b95

File tree

9 files changed

+20
-21
lines changed

9 files changed

+20
-21
lines changed

tests/e2e/tests/build/poll.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
killAllProcesses,
33
waitForAnyProcessOutputToMatch,
4-
silentExecAndWaitForOutputToMatch
4+
execAndWaitForOutputToMatch
55
} from '../../utils/process';
66
import {appendToFile} from '../../utils/fs';
77
import {expectToFail, wait} from '../../utils/utils';
@@ -19,7 +19,7 @@ export default function() {
1919
}
2020

2121

22-
return silentExecAndWaitForOutputToMatch('ng', ['serve', '--poll=10000'], webpackGoodRegEx)
22+
return execAndWaitForOutputToMatch('ng', ['serve', '--poll=10000'], webpackGoodRegEx)
2323
// Wait before editing a file.
2424
// Editing too soon seems to trigger a rebuild and throw polling out of whack.
2525
.then(() => wait(2000))

tests/e2e/tests/build/rebuild-css-change.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
killAllProcesses,
33
exec,
44
waitForAnyProcessOutputToMatch,
5-
silentExecAndWaitForOutputToMatch
5+
execAndWaitForOutputToMatch
66
} from '../../utils/process';
77
import {appendToFile} from '../../utils/fs';
88
import {getGlobalVariable} from '../../utils/env';
@@ -19,7 +19,7 @@ export default function() {
1919
}
2020

2121

22-
return silentExecAndWaitForOutputToMatch('ng', ['serve'], webpackGoodRegEx)
22+
return execAndWaitForOutputToMatch('ng', ['serve'], webpackGoodRegEx)
2323
// Should trigger a rebuild.
2424
.then(() => exec('touch', 'src/main.ts'))
2525
.then(() => waitForAnyProcessOutputToMatch(webpackGoodRegEx, 10000))

tests/e2e/tests/build/rebuild-deps-type-check.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
killAllProcesses,
33
waitForAnyProcessOutputToMatch,
4-
silentExecAndWaitForOutputToMatch,
4+
execAndWaitForOutputToMatch,
55
} from '../../utils/process';
66
import {writeFile, prependToFile, appendToFile} from '../../utils/fs';
77
import {wait} from '../../utils/utils';
@@ -39,7 +39,7 @@ export default function() {
3939
`))
4040
.then(() => wait(2000))
4141
// Should trigger a rebuild, no error expected.
42-
.then(() => silentExecAndWaitForOutputToMatch('ng', ['serve'], doneRe))
42+
.then(() => execAndWaitForOutputToMatch('ng', ['serve'], doneRe))
4343
// Make an invalid version of the file.
4444
.then(() => writeFile('src/funky2.ts', `
4545
export function funky2(value: number): number {

tests/e2e/tests/build/rebuild.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
killAllProcesses,
33
exec,
44
waitForAnyProcessOutputToMatch,
5-
silentExecAndWaitForOutputToMatch,
5+
execAndWaitForOutputToMatch,
66
ng,
77
} from '../../utils/process';
88
import {writeFile, writeMultipleFiles} from '../../utils/fs';
@@ -25,7 +25,7 @@ export default function() {
2525
let oldNumberOfChunks = 0;
2626
const chunkRegExp = /chunk\s+\{/g;
2727

28-
return silentExecAndWaitForOutputToMatch('ng', ['serve'], validBundleRegEx)
28+
return execAndWaitForOutputToMatch('ng', ['serve'], validBundleRegEx)
2929
// Should trigger a rebuild.
3030
.then(() => exec('touch', 'src/main.ts'))
3131
.then(() => waitForAnyProcessOutputToMatch(invalidBundleRegEx, 10000))

tests/e2e/tests/build/watch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
killAllProcesses,
33
exec,
44
waitForAnyProcessOutputToMatch,
5-
silentExecAndWaitForOutputToMatch
5+
execAndWaitForOutputToMatch
66
} from '../../utils/process';
77
import { expectToFail } from '../../utils/utils';
88

@@ -14,15 +14,15 @@ export default function () {
1414
return Promise.resolve();
1515
}
1616

17-
return silentExecAndWaitForOutputToMatch('ng', ['serve'], webpackGoodRegEx)
17+
return execAndWaitForOutputToMatch('ng', ['serve'], webpackGoodRegEx)
1818
// Should trigger a rebuild.
1919
.then(() => exec('touch', 'src/main.ts'))
2020
.then(() => waitForAnyProcessOutputToMatch(webpackGoodRegEx, 5000))
2121
.then(() => killAllProcesses(), (err: any) => {
2222
killAllProcesses();
2323
throw err;
2424
})
25-
.then(() => silentExecAndWaitForOutputToMatch('ng', ['serve', '--no-watch'], webpackGoodRegEx))
25+
.then(() => execAndWaitForOutputToMatch('ng', ['serve', '--no-watch'], webpackGoodRegEx))
2626
// Should not trigger a rebuild when not watching files.
2727
.then(() => exec('touch', 'src/main.ts'))
2828
.then(() => expectToFail(() => waitForAnyProcessOutputToMatch(webpackGoodRegEx, 5000)))

tests/e2e/tests/misc/live-reload.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as http from 'http';
66
import {appendToFile, writeMultipleFiles, writeFile} from '../../utils/fs';
77
import {
88
killAllProcesses,
9-
silentExecAndWaitForOutputToMatch,
9+
execAndWaitForOutputToMatch,
1010
waitForAnyProcessOutputToMatch
1111
} from '../../utils/process';
1212
import { wait } from '../../utils/utils';
@@ -96,7 +96,7 @@ export default function () {
9696
}
9797
`
9898
}))
99-
.then(_ => silentExecAndWaitForOutputToMatch(
99+
.then(_ => execAndWaitForOutputToMatch(
100100
'ng',
101101
['e2e', '--watch', '--live-reload'],
102102
protractorGoodRegEx
@@ -116,7 +116,7 @@ export default function () {
116116
.then(_ => killAllProcesses(), (err) => { killAllProcesses(); throw err; })
117117
.then(_ => resetApiVars())
118118
// Serve with live reload off should call api only once.
119-
.then(_ => silentExecAndWaitForOutputToMatch(
119+
.then(_ => execAndWaitForOutputToMatch(
120120
'ng',
121121
['e2e', '--watch', '--no-live-reload'],
122122
protractorGoodRegEx
@@ -150,7 +150,7 @@ export default function () {
150150
http.get('http://${publicHost + '/live-reload-count'}').subscribe(res => null);
151151
}
152152
}`))
153-
.then(_ => silentExecAndWaitForOutputToMatch(
153+
.then(_ => execAndWaitForOutputToMatch(
154154
'ng',
155155
['e2e', '--watch', '--host=0.0.0.0', '--port=4200', `--public-host=${publicHost}`, '--proxy', proxyConfigFile],
156156
protractorGoodRegEx

tests/e2e/tests/test/e2e.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
ng,
33
npm,
44
execAndWaitForOutputToMatch,
5-
silentExecAndWaitForOutputToMatch,
65
killAllProcesses
76
} from '../../utils/process';
87
import { updateJsonFile } from '../../utils/project';
@@ -43,7 +42,7 @@ export default function () {
4342
throw err;
4443
})
4544
// Should run side-by-side with `ng serve`
46-
.then(() => silentExecAndWaitForOutputToMatch('ng', ['serve'],
45+
.then(() => execAndWaitForOutputToMatch('ng', ['serve'],
4746
/webpack: Compiled successfully./))
4847
.then(() => ng('e2e'));
4948
}

tests/e2e/tests/test/test-fail-watch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
killAllProcesses,
33
waitForAnyProcessOutputToMatch,
4-
silentExecAndWaitForOutputToMatch
4+
execAndWaitForOutputToMatch
55
} from '../../utils/process';
66
import { expectToFail } from '../../utils/utils';
77
import { readFile, writeFile } from '../../utils/fs';
@@ -12,7 +12,7 @@ const karmaGoodRegEx = /Executed 3 of 3 SUCCESS \(\d+\.\d+ secs/;
1212

1313
export default function () {
1414
let originalSpec: string;
15-
return silentExecAndWaitForOutputToMatch('ng', ['test'], karmaGoodRegEx)
15+
return execAndWaitForOutputToMatch('ng', ['test'], karmaGoodRegEx)
1616
.then(() => readFile('src/app/app.component.spec.ts'))
1717
.then((data) => originalSpec = data)
1818
// Trigger a failed rebuild, which shouldn't run tests again.

tests/e2e/utils/project.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {readFile, writeFile} from './fs';
2-
import {silentExecAndWaitForOutputToMatch, silentNpm, ng} from './process';
2+
import {execAndWaitForOutputToMatch, silentNpm, ng} from './process';
33
import {getGlobalVariable} from './env';
44

55
const packages = require('../../../lib/packages').packages;
@@ -25,7 +25,7 @@ export function updateTsConfig(fn: (json: any) => any | void) {
2525

2626

2727
export function ngServe(...args: string[]) {
28-
return silentExecAndWaitForOutputToMatch('ng',
28+
return execAndWaitForOutputToMatch('ng',
2929
['serve', ...args],
3030
/webpack: bundle is now VALID|webpack: Compiled successfully./);
3131
}

0 commit comments

Comments
 (0)