15 | * server = new Server(config, [done])
16 | * server.start()
17 | *
18 | * instead.
19 | */
20 | server: DeprecatedServer;
21 | Server: Server;
22 | runner: Runner;
23 | stopper: Stopper;
24 | launcher: Launcher;
25 | VERSION: string;
26 | }
27 |
28 | interface LauncherStatic {
29 | generateId(): string;
30 | //TODO: injector should be of type `di.Injector`
31 | new (emitter: NodeJS.EventEmitter, injector: any): Launcher;
32 | }
33 |
34 | interface Launcher {
35 | Launcher: LauncherStatic;
36 | //TODO: Can this return value ever be typified?
37 | launch(names: string[], protocol: string, hostname: string, port: number, urlRoot: string): any[];
38 | kill(id: string, callback: Function): boolean;
39 | restart(id: string): boolean;
40 | killAll(callback: Function): void;
41 | areAllCaptured(): boolean;
42 | markCaptured(id: string): void;
43 | }
44 |
45 | interface DeprecatedServer {
46 | start(options?: any, callback?: ServerCallback): void;
47 | }
48 |
49 | interface Runner {
50 | run(options?: ConfigOptions | ConfigFile, callback?: ServerCallback): void;
51 | }
52 |
53 |
54 | interface Stopper {
55 | /**
56 | * This function will signal a running server to stop. The equivalent of karma stop.
57 | */
58 | stop(options?: ConfigOptions, callback?: ServerCallback): void;
59 | }
60 |
61 |
62 | interface TestResults {
63 | disconnected: boolean;
64 | error: boolean;
65 | exitCode: number;
66 | failed: number;
67 | success: number;
68 | }
69 |
70 | interface Server extends NodeJS.EventEmitter {
71 | new (options?: ConfigOptions | ConfigFile, callback?: ServerCallback): Server;
72 | /**
73 | * Start the server
74 | */
75 | start(): void;
76 | /**
77 | * Get properties from the injector
78 | * @param token
79 | */
80 | get(token: string): any;
81 | /**
82 | * Force a refresh of the file list
83 | */
84 | refreshFiles(): Promisefiles and exclude.
134 | * If the basePath configuration is a relative path then it will be resolved to
135 | * the __dirname of the configuration file.
136 | */
137 | basePath?: string;
138 | /**
139 | * @default 2000
140 | * @description How long does Karma wait for a browser to reconnect (in ms).
141 | *
142 | * With a flaky connection it is pretty common that the browser disconnects,
143 | * but the actual test execution is still running without any problems. Karma does not treat a disconnection
144 | * as immediate failure and will wait browserDisconnectTimeout (ms).
145 | * If the browser reconnects during that time, everything is fine.
146 | *
153 | * The disconnectTolerance value represents the maximum number of tries a browser will attempt
154 | * in the case of a disconnection. Usually any disconnection is considered a failure,
155 | * but this option allows you to define a tolerance level when there is a flaky network link between
156 | * the Karma server and the browsers.
157 | *
164 | * If, during test execution, Karma does not receive any message from a browser within
165 | * browserNoActivityTimeout (ms), it will disconnect from the browser
166 | *
http://localhost:9876/).
185 | */
186 | browsers?: string[];
187 | /**
188 | * @default 60000
189 | * @description Timeout for capturing a browser (in ms).
190 | *
191 | * The captureTimeout value represents the maximum boot-up time allowed for a
192 | * browser to start and connect to Karma. If any browser does not get captured within the timeout, Karma
193 | * will kill it and try to launch it again and, after three attempts to capture it, Karma will give up.
194 | *
'https:' requires you to specify httpsServerOptions.
289 | */
290 | protocol?: string;
291 | /**
292 | * @default {}
293 | * @description A map of path-proxy pairs.
294 | */
295 | proxies?: { [path: string]: string }
296 | /**
297 | * @default true
298 | * @description Whether or not Karma or any browsers should raise an error when an inavlid SSL certificate is found.
299 | */
300 | proxyValidateSSL?: boolean;
301 | /**
302 | * @default 0
303 | * @description Karma will report all the tests that are slower than given time limit (in ms).
304 | * This is disabled by default (since the default value is 0).
305 | */
306 | reportSlowerThan?: number;
307 | /**
308 | * @default ['progress']
309 | * Possible Values:
310 | * autoWatch is true all files that have set watched to true will be watched
374 | * for changes.
375 | */
376 | watched?: boolean;
377 | /**
378 | * @default true
379 | * @description Should the files be included in the browser using