taskRunner.d.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /// <reference types="node" />
  2. /// <reference types="q" />
  3. import { EventEmitter } from 'events';
  4. import * as q from 'q';
  5. import { Config } from './config';
  6. export interface RunResults {
  7. taskId: number;
  8. specs: Array<string>;
  9. capabilities: any;
  10. failedCount: number;
  11. exitCode: number;
  12. specResults: Array<any>;
  13. }
  14. /**
  15. * A runner for running a specified task (capabilities + specs).
  16. * The TaskRunner can either run the task from the current process (via
  17. * './runner.js') or from a new process (via './runnerCli.js').
  18. *
  19. * @constructor
  20. * @param {string} configFile Path of test configuration.
  21. * @param {object} additionalConfig Additional configuration.
  22. * @param {object} task Task to run.
  23. * @param {boolean} runInFork Whether to run test in a forked process.
  24. * @constructor
  25. */
  26. export declare class TaskRunner extends EventEmitter {
  27. private configFile;
  28. private additionalConfig;
  29. private task;
  30. private runInFork;
  31. constructor(configFile: string, additionalConfig: Config, task: any, runInFork: boolean);
  32. /**
  33. * Sends the run command.
  34. * @return {q.Promise} A promise that will resolve when the task finishes
  35. * running. The promise contains the following parameters representing the
  36. * result of the run:
  37. * taskId, specs, capabilities, failedCount, exitCode, specResults
  38. */
  39. run(): q.Promise<any>;
  40. }