1 | import { CoverageMap } from 'istanbul-lib-coverage';
|
2 | import { Instrumenter } from 'istanbul-lib-instrument';
|
3 | import { MapStore } from 'istanbul-lib-source-maps';
|
4 | import { CancellablePromise } from '@theintern/common';
|
5 | import Command from '@theintern/leadfoot/Command';
|
6 | import Tunnel, { DownloadProgressEvent } from '@theintern/digdug/Tunnel';
|
7 | import { Config, EnvironmentSpec } from '../common/config';
|
8 | import Executor, { Events, Plugins } from './Executor';
|
9 | import Environment from '../Environment';
|
10 | import Server from '../Server';
|
11 | import Suite from '../Suite';
|
12 | import { RuntimeEnvironment } from '../types';
|
13 | export default class Node extends Executor<NodeEvents, Config, NodePlugins> {
|
14 | server: Server | undefined;
|
15 | tunnel: Tunnel | undefined;
|
16 | protected _coverageMap: CoverageMap;
|
17 | protected _coverageFiles: string[];
|
18 | protected _loadingFunctionalSuites: boolean | undefined;
|
19 | protected _instrumentBasePath: string | undefined;
|
20 | protected _instrumenter: Instrumenter | undefined;
|
21 | protected _sourceMaps: MapStore;
|
22 | protected _instrumentedMaps: MapStore;
|
23 | protected _unhookRequire: (() => void) | undefined;
|
24 | protected _sessionSuites: Suite[] | undefined;
|
25 | constructor(options?: {
|
26 | [key in keyof Config]?: any;
|
27 | });
|
28 | get coverageMap(): CoverageMap;
|
29 | get environment(): RuntimeEnvironment;
|
30 | get instrumentedMapStore(): MapStore;
|
31 | get sourceMapStore(): MapStore;
|
32 | get hasCoveredFiles(): boolean;
|
33 | get suites(): Suite[];
|
34 | addSuite(factory: (parentSuite: Suite) => void): void;
|
35 | getTunnel(name: string): typeof Tunnel;
|
36 | instrumentCode(code: string, filename: string, shouldCompile?: boolean): string;
|
37 | loadScript(script: string | string[]): CancellablePromise<void>;
|
38 | registerTunnel(name: string, Ctor: typeof Tunnel): void;
|
39 | shouldInstrumentFile(filename: string): boolean;
|
40 | protected _afterRun(): CancellablePromise<void>;
|
41 | protected _beforeRun(): CancellablePromise<boolean>;
|
42 | protected _createTunnel(): Tunnel;
|
43 | protected _createSessionSuites(): void;
|
44 | protected _loadFunctionalSuites(): CancellablePromise<void>;
|
45 | protected _loadSuites(): CancellablePromise<void>;
|
46 | protected _resolveConfig(): CancellablePromise<void | undefined>;
|
47 | protected _getSeleniumDriverNames(): string[];
|
48 | protected _runTests(): CancellablePromise<void>;
|
49 | protected _runRemoteTests(): CancellablePromise<void>;
|
50 | protected _setInstrumentationHooks(): void;
|
51 | protected _removeInstrumentationHooks(): void;
|
52 | }
|
53 | export { Config, EnvironmentSpec };
|
54 | export interface NodePlugins extends Plugins {
|
55 | tunnel: typeof Tunnel;
|
56 | }
|
57 | export interface Remote extends Command<any> {
|
58 | environmentType?: Environment;
|
59 | requestedEnvironment?: Environment;
|
60 | setHeartbeatInterval(delay: number): Command<any>;
|
61 | }
|
62 | export interface TunnelMessage {
|
63 | tunnel: Tunnel;
|
64 | progress?: DownloadProgressEvent;
|
65 | status?: string;
|
66 | }
|
67 | export interface NodeEvents extends Events {
|
68 | serverEnd: Server;
|
69 | serverStart: Server;
|
70 | tunnelDownloadProgress: TunnelMessage;
|
71 | tunnelStart: TunnelMessage;
|
72 | tunnelStatus: TunnelMessage;
|
73 | tunnelStop: TunnelMessage;
|
74 | }
|
75 |
|
\ | No newline at end of file |