* server = new Server(config, [done])
* server.start()
*
* instead.
*/
server: DeprecatedServer;
Server: Server;
runner: Runner;
stopper: Stopper;
launcher: Launcher;
VERSION: string;
}
interface LauncherStatic {
generateId(): string;
//TODO: injector should be of type `di.Injector`
new (emitter: NodeJS.EventEmitter, injector: any): Launcher;
}
interface Launcher {
Launcher: LauncherStatic;
//TODO: Can this return value ever be typified?
launch(names: string[], protocol: string, hostname: string, port: number, urlRoot: string): any[];
kill(id: string, callback: Function): boolean;
restart(id: string): boolean;
killAll(callback: Function): void;
areAllCaptured(): boolean;
markCaptured(id: string): void;
}
interface DeprecatedServer {
start(options?: any, callback?: ServerCallback): void;
}
interface Runner {
run(options?: ConfigOptions | ConfigFile, callback?: ServerCallback): void;
}
interface Stopper {
/**
* This function will signal a running server to stop. The equivalent of karma stop.
*/
stop(options?: ConfigOptions, callback?: ServerCallback): void;
}
interface TestResults {
disconnected: boolean;
error: boolean;
exitCode: number;
failed: number;
success: number;
}
interface Server extends NodeJS.EventEmitter {
new (options?: ConfigOptions | ConfigFile, callback?: ServerCallback): Server;
/**
* Start the server
*/
start(): void;
/**
* Get properties from the injector
* @param token
*/
get(token: string): any;
/**
* Force a refresh of the file list
*/
refreshFiles(): Promisefiles and exclude.
* If the basePath configuration is a relative path then it will be resolved to
* the __dirname of the configuration file.
*/
basePath?: string;
/**
* @default 2000
* @description How long does Karma wait for a browser to reconnect (in ms).
*
* With a flaky connection it is pretty common that the browser disconnects,
* but the actual test execution is still running without any problems. Karma does not treat a disconnection
* as immediate failure and will wait browserDisconnectTimeout (ms).
* If the browser reconnects during that time, everything is fine.
*
* The disconnectTolerance value represents the maximum number of tries a browser will attempt
* in the case of a disconnection. Usually any disconnection is considered a failure,
* but this option allows you to define a tolerance level when there is a flaky network link between
* the Karma server and the browsers.
*
* If, during test execution, Karma does not receive any message from a browser within
* browserNoActivityTimeout (ms), it will disconnect from the browser
*
http://localhost:9876/).
*/
browsers?: string[];
/**
* @default 60000
* @description Timeout for capturing a browser (in ms).
*
* The captureTimeout value represents the maximum boot-up time allowed for a
* browser to start and connect to Karma. If any browser does not get captured within the timeout, Karma
* will kill it and try to launch it again and, after three attempts to capture it, Karma will give up.
*
'https:' requires you to specify httpsServerOptions.
*/
protocol?: string;
/**
* @default {}
* @description A map of path-proxy pairs.
*/
proxies?: { [path: string]: string }
/**
* @default true
* @description Whether or not Karma or any browsers should raise an error when an inavlid SSL certificate is found.
*/
proxyValidateSSL?: boolean;
/**
* @default 0
* @description Karma will report all the tests that are slower than given time limit (in ms).
* This is disabled by default (since the default value is 0).
*/
reportSlowerThan?: number;
/**
* @default ['progress']
* Possible Values:
* autoWatch is true all files that have set watched to true will be watched
* for changes.
*/
watched?: boolean;
/**
* @default true
* @description Should the files be included in the browser using