-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Expand file tree
/
Copy pathconfig-get.ts
More file actions
34 lines (29 loc) · 1.31 KB
/
config-get.ts
File metadata and controls
34 lines (29 loc) · 1.31 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
import assert from 'node:assert/strict';
import { ng } from '../../../utils/process';
import { expectToFail } from '../../../utils/utils';
export default async function () {
await expectToFail(() => ng('config', 'schematics.@schematics/angular.component.inlineStyle'));
await ng('config', 'schematics.@schematics/angular.component.inlineStyle', 'false');
const { stdout } = await ng('config', 'schematics.@schematics/angular.component.inlineStyle');
assert.match(stdout, /false\n?/);
await ng('config', 'schematics.@schematics/angular.component.inlineStyle', 'true');
const { stdout: stdout1 } = await ng(
'config',
'schematics.@schematics/angular.component.inlineStyle',
);
assert.match(stdout1, /true\n?/);
await ng('config', 'schematics.@schematics/angular.component.inlineStyle', 'false');
const { stdout: stdout2 } = await ng(
'config',
`projects.test-project.architect.build.options.assets[0]`,
);
assert.ok(stdout2.includes('"input": "public"'));
const { stdout: stdout3 } = await ng(
'config',
`projects["test-project"].architect.build.options.assets[0]`,
);
assert.ok(stdout3.includes('"input": "public"'));
// should print all config when no positional args are provided.
const { stdout: stdout4 } = await ng('config');
assert.ok(stdout4.includes('$schema'));
}