source: trip-planner-front/node_modules/@angular-devkit/build-angular/src/testing/builder-harness.d.ts@ e29cc2e

Last change on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8/// <reference types="node" />
9import { BuilderHandlerFn, BuilderInfo, BuilderOutput } from '@angular-devkit/architect';
10import { TestProjectHost } from '@angular-devkit/architect/testing';
11import { json, logging } from '@angular-devkit/core';
12import { Observable } from 'rxjs';
13export interface BuilderHarnessExecutionResult<T extends BuilderOutput = BuilderOutput> {
14 result?: T;
15 error?: Error;
16 logs: readonly logging.LogEntry[];
17}
18export interface BuilderHarnessExecutionOptions {
19 configuration: string;
20 outputLogsOnFailure: boolean;
21 outputLogsOnException: boolean;
22 useNativeFileWatching: boolean;
23}
24export declare class BuilderHarness<T> {
25 private readonly builderHandler;
26 private readonly host;
27 private readonly builderInfo;
28 private schemaRegistry;
29 private projectName;
30 private projectMetadata;
31 private targetName?;
32 private options;
33 private builderTargets;
34 private watcherNotifier?;
35 constructor(builderHandler: BuilderHandlerFn<T & json.JsonObject>, host: TestProjectHost, builderInfo?: Partial<BuilderInfo>);
36 useProject(name: string, metadata?: Record<string, unknown>): this;
37 useTarget(name: string, baseOptions: T): this;
38 withConfiguration(configuration: string, options: T): this;
39 withBuilderTarget<O>(target: string, handler: BuilderHandlerFn<O & json.JsonObject>, options?: O, info?: Partial<BuilderInfo>): this;
40 execute(options?: Partial<BuilderHarnessExecutionOptions>): Observable<BuilderHarnessExecutionResult>;
41 executeOnce(options?: Partial<BuilderHarnessExecutionOptions>): Promise<BuilderHarnessExecutionResult>;
42 appendToFile(path: string, content: string): Promise<void>;
43 writeFile(path: string, content: string | Buffer): Promise<void>;
44 writeFiles(files: Record<string, string | Buffer>): Promise<void>;
45 removeFile(path: string): Promise<void>;
46 modifyFile(path: string, modifier: (content: string) => string | Promise<string>): Promise<void>;
47 hasFile(path: string): boolean;
48 hasFileMatch(directory: string, pattern: RegExp): boolean;
49 readFile(path: string): string;
50 private validateProjectName;
51}
Note: See TracBrowser for help on using the repository browser.