-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Expand file tree
/
Copy pathschematic-defaults.ts
More file actions
38 lines (33 loc) · 1.04 KB
/
schematic-defaults.ts
File metadata and controls
38 lines (33 loc) · 1.04 KB
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
28
29
30
31
32
33
34
35
36
37
38
import assert from 'node:assert/strict';
import { ng } from '../../utils/process';
import { updateJsonFile } from '../../utils/project';
export default async function () {
await updateJsonFile('angular.json', (config) => {
config.projects['test-project'].schematics = {
'@schematics/angular:component': {
style: 'scss',
},
};
});
// Generate component in application to verify that it's minimal
const { stdout } = await ng('generate', 'component', 'foo');
assert.match(stdout, /foo\.scss/);
// Generate another project with different settings
await ng('generate', 'application', 'test-project-two', '--no-minimal');
await updateJsonFile('angular.json', (config) => {
config.projects['test-project-two'].schematics = {
'@schematics/angular:component': {
style: 'less',
type: 'Component',
},
};
});
const { stdout: stdout2 } = await ng(
'generate',
'component',
'foo',
'--project',
'test-project-two',
);
assert.match(stdout2, /foo\.component\.less/);
}