- * server = new Server(config, [done])
- * server.start()
- *
- * instead.
- *
- * @deprecated
- */
- const server: DeprecatedServer;
+/**
+ * `start` method is deprecated since 0.13. It will be removed in 0.14.
+ * Please use
+ *
+ * server = new Server(config, [done])
+ * server.start()
+ *
+ * instead.
+ *
+ * @deprecated
+ */
+export const server: DeprecatedServer;
- const runner: Runner;
- const stopper: Stopper;
+export const runner: Runner;
+export const stopper: Stopper;
- const VERSION: string;
- const constants: Constants;
+export const VERSION: string;
+export const constants: Constants;
- interface Constants {
- VERSION: string;
- DEFAULT_PORT: number;
- DEFAULT_HOSTNAME: string;
- DEFAULT_LISTEN_ADDR: string;
- LOG_DISABLE: string;
- LOG_ERROR: string;
- LOG_WARN: string;
- LOG_INFO: string;
- LOG_DEBUG: string;
- LOG_LOG: string;
- LOG_PRIORITIES: string[];
- COLOR_PATTERN: string;
- NO_COLOR_PATTERN: string;
- CONSOLE_APPENDER: {
+export interface Constants {
+ VERSION: string;
+ DEFAULT_PORT: number;
+ DEFAULT_HOSTNAME: string;
+ DEFAULT_LISTEN_ADDR: string;
+ LOG_DISABLE: string;
+ LOG_ERROR: string;
+ LOG_WARN: string;
+ LOG_INFO: string;
+ LOG_DEBUG: string;
+ LOG_LOG: string;
+ LOG_PRIORITIES: string[];
+ COLOR_PATTERN: string;
+ NO_COLOR_PATTERN: string;
+ CONSOLE_APPENDER: {
+ type: string;
+ layout: {
type: string;
- layout: {
- type: string;
- pattern: string;
- };
+ pattern: string;
};
- EXIT_CODE: string;
- }
+ };
+ EXIT_CODE: string;
+}
- namespace launcher {
- class Launcher {
- static generateId(): string;
+export namespace launcher {
+ class Launcher {
+ static generateId(): string;
- constructor(emitter: NodeJS.EventEmitter, injector: any);
+ constructor(emitter: NodeJS.EventEmitter, injector: any);
- // TODO: Can this return value ever be typified?
- launch(names: string[], protocol: string, hostname: string, port: number, urlRoot: string): any[];
- kill(id: string, callback: () => void): boolean;
- restart(id: string): boolean;
- killAll(callback: () => void): void;
- areAllCaptured(): boolean;
- markCaptured(id: string): void;
- }
- }
-
- /** @deprecated */
- interface DeprecatedServer {
- /** @deprecated */
- 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;
- }
-
- class Server extends NodeJS.EventEmitter {
- constructor(options?: ConfigOptions | ConfigFile, callback?: ServerCallback);
- /**
- * 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