UNPKG

3.14 kBTypeScriptView Raw
1import { CoverageMap } from 'istanbul-lib-coverage';
2import { Instrumenter } from 'istanbul-lib-instrument';
3import { MapStore } from 'istanbul-lib-source-maps';
4import { CancellablePromise } from '@theintern/common';
5import Command from '@theintern/leadfoot/Command';
6import Tunnel, { DownloadProgressEvent } from '@theintern/digdug/Tunnel';
7import { Config, EnvironmentSpec } from '../common/config';
8import Executor, { Events, Plugins } from './Executor';
9import Environment from '../Environment';
10import Server from '../Server';
11import Suite from '../Suite';
12import { RuntimeEnvironment } from '../types';
13export 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}
53export { Config, EnvironmentSpec };
54export interface NodePlugins extends Plugins {
55 tunnel: typeof Tunnel;
56}
57export interface Remote extends Command<any> {
58 environmentType?: Environment;
59 requestedEnvironment?: Environment;
60 setHeartbeatInterval(delay: number): Command<any>;
61}
62export interface TunnelMessage {
63 tunnel: Tunnel;
64 progress?: DownloadProgressEvent;
65 status?: string;
66}
67export 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