"Fossies" - the Fresh Open Source Software Archive 
Member "angular-cli-15.2.4/tests/legacy-cli/e2e/tests/commands/additional-properties.ts" (16 Mar 2023, 1308 Bytes) of package /linux/www/angular-cli-15.2.4.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 import { createDir, rimraf, writeMultipleFiles } from '../../utils/fs';
2 import { execAndWaitForOutputToMatch } from '../../utils/process';
3 import { updateJsonFile } from '../../utils/project';
4
5 export default async function () {
6 await createDir('example-builder');
7 await writeMultipleFiles({
8 'example-builder/package.json': '{ "builders": "./builders.json" }',
9 'example-builder/schema.json':
10 '{ "$schema": "http://json-schema.org/draft-07/schema", "type": "object", "additionalProperties": true }',
11 'example-builder/builders.json':
12 '{ "$schema": "@angular-devkit/architect/src/builders-schema.json", "builders": { "example": { "implementation": "./example", "schema": "./schema.json" } } }',
13 'example-builder/example.js':
14 'module.exports.default = require("@angular-devkit/architect").createBuilder((options) => { console.log(options); return { success: true }; });',
15 });
16
17 await updateJsonFile('angular.json', (json) => {
18 const appArchitect = json.projects['test-project'].architect;
19 appArchitect.example = {
20 builder: './example-builder:example',
21 };
22 });
23
24 await execAndWaitForOutputToMatch(
25 'ng',
26 ['run', 'test-project:example', '--additional', 'property'],
27 /Unknown argument: additional/,
28 );
29
30 await rimraf('example-builder');
31 }