Skip to content

Commit 32f4ec1

Browse files
committed
fix(@angular/cli): Updated duplicate test messages
1 parent 4db16ac commit 32f4ec1

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ng } from '../../../utils/process';
2+
import { oneLine } from 'common-tags';
3+
4+
export default function () {
5+
return ng('generate', 'component', 'test-component')
6+
.then((output) => {
7+
if (!output.stdout.match(/UPDATE src[\\|\/]app[\\|\/]app.module.ts/)) {
8+
throw new Error(oneLine`
9+
Expected to match
10+
"UPDATE src/app/app.module.ts"
11+
in ${output.stdout}.`);
12+
}
13+
})
14+
.then(() => ng('generate', 'component', 'test-component'))
15+
.then((output) => {
16+
if (!output.stdout.match(/ERROR! src[\\|\/]app[\\|\/]test-component[\\|\/]test-component.component.ts already exists./)) {
17+
throw new Error(oneLine`
18+
Expected to match
19+
"ERROR! src/app/test-component/test-component.ts"
20+
in ${output.stdout}.`);
21+
}
22+
});
23+
}

0 commit comments

Comments
 (0)