-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Expand file tree
/
Copy pathgenerate-name-check.ts
More file actions
27 lines (24 loc) · 962 Bytes
/
generate-name-check.ts
File metadata and controls
27 lines (24 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { join } from 'node:path';
import { ng } from '../../utils/process';
import { expectFileToExist } from '../../utils/fs';
import { updateJsonFile } from '../../utils/project';
export default function () {
const compDir = join('src', 'app', 'test-component');
return (
Promise.resolve()
.then(() =>
updateJsonFile('package.json', (configJson) => {
delete configJson.name;
return configJson;
}),
)
.then(() => ng('generate', 'component', 'test-component'))
.then(() => expectFileToExist(compDir))
.then(() => expectFileToExist(join(compDir, 'test-component.ts')))
.then(() => expectFileToExist(join(compDir, 'test-component.spec.ts')))
.then(() => expectFileToExist(join(compDir, 'test-component.html')))
.then(() => expectFileToExist(join(compDir, 'test-component.css')))
// Try to run the unit tests.
.then(() => ng('test', '--watch=false'))
);
}