util.d.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /// <reference types="q" />
  2. import { Promise } from 'q';
  3. /**
  4. * Utility function that filters a stack trace to be more readable. It removes
  5. * Jasmine test frames and webdriver promise resolution.
  6. * @param {string} text Original stack trace.
  7. * @return {string}
  8. */
  9. export declare function filterStackTrace(text: string): string;
  10. /**
  11. * Internal helper for abstraction of polymorphic filenameOrFn properties.
  12. * @param {object} filenameOrFn The filename or function that we will execute.
  13. * @param {Array.<object>}} args The args to pass into filenameOrFn.
  14. * @return {q.Promise} A promise that will resolve when filenameOrFn completes.
  15. */
  16. export declare function runFilenameOrFn_(configDir: string, filenameOrFn: any, args?: any[]): Promise<any>;
  17. /**
  18. * Joins two logs of test results, each following the format of <framework>.run
  19. * @param {object} log1
  20. * @param {object} log2
  21. * @return {object} The joined log
  22. */
  23. export declare function joinTestLogs(log1: any, log2: any): any;
  24. /**
  25. * Returns false if an error indicates a missing or stale element, re-throws
  26. * the error otherwise
  27. *
  28. * @param {*} The error to check
  29. * @throws {*} The error it was passed if it doesn't indicate a missing or stale
  30. * element
  31. * @return {boolean} false, if it doesn't re-throw the error
  32. */
  33. export declare function falseIfMissing(error: any): boolean;
  34. /**
  35. * Return a boolean given boolean value.
  36. *
  37. * @param {boolean} value
  38. * @returns {boolean} given value
  39. */
  40. export declare function passBoolean(value: boolean): boolean;