-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Expand file tree
/
Copy pathadditional-properties.ts
More file actions
31 lines (27 loc) · 1.28 KB
/
additional-properties.ts
File metadata and controls
31 lines (27 loc) · 1.28 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
import { createDir, rimraf, writeMultipleFiles } from '../../utils/fs';
import { execAndWaitForOutputToMatch } from '../../utils/process';
import { updateJsonFile } from '../../utils/project';
export default async function () {
await createDir('example-builder');
await writeMultipleFiles({
'example-builder/package.json': '{ "builders": "./builders.json" }',
'example-builder/schema.json':
'{ "$schema": "http://json-schema.org/draft-07/schema", "type": "object", "additionalProperties": true }',
'example-builder/builders.json':
'{ "$schema": "@angular-devkit/architect/src/builders-schema.json", "builders": { "example": { "implementation": "./example", "schema": "./schema.json" } } }',
'example-builder/example.js':
'module.exports.default = require("@angular-devkit/architect").createBuilder((options) => { console.log(options); return { success: true }; });',
});
await updateJsonFile('angular.json', (json) => {
const appArchitect = json.projects['test-project'].architect;
appArchitect.example = {
builder: './example-builder:example',
};
});
await execAndWaitForOutputToMatch(
'ng',
['run', 'test-project:example', '--additional', 'property'],
/Unknown argument: additional/,
);
await rimraf('example-builder');
}