default-processor.js 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = function (d, b) {
  4. extendStatics = Object.setPrototypeOf ||
  5. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  7. return extendStatics(d, b);
  8. };
  9. return function (d, b) {
  10. if (typeof b !== "function" && b !== null)
  11. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  12. extendStatics(d, b);
  13. function __() { this.constructor = d; }
  14. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15. };
  16. })();
  17. Object.defineProperty(exports, "__esModule", { value: true });
  18. exports.DefaultProcessor = void 0;
  19. var configuration_1 = require("../configuration");
  20. var display_processor_1 = require("../display-processor");
  21. var DefaultProcessor = /** @class */ (function (_super) {
  22. __extends(DefaultProcessor, _super);
  23. function DefaultProcessor() {
  24. return _super !== null && _super.apply(this, arguments) || this;
  25. }
  26. DefaultProcessor.displaySpecDescription = function (spec) {
  27. return spec.description;
  28. };
  29. DefaultProcessor.prototype.displayJasmineStarted = function () {
  30. return "Jasmine started";
  31. };
  32. DefaultProcessor.prototype.displaySuite = function (suite) {
  33. return suite.description;
  34. };
  35. DefaultProcessor.prototype.displaySuccessfulSpec = function (spec) {
  36. return DefaultProcessor.displaySpecDescription(spec);
  37. };
  38. DefaultProcessor.prototype.displayFailedSpec = function (spec) {
  39. return DefaultProcessor.displaySpecDescription(spec);
  40. };
  41. DefaultProcessor.prototype.displaySpecErrorMessages = function (spec) {
  42. return this.displayErrorMessages(spec, this.configuration.spec.displayStacktrace);
  43. };
  44. DefaultProcessor.prototype.displaySummaryErrorMessages = function (spec) {
  45. return this.displayErrorMessages(spec, this.configuration.summary.displayStacktrace);
  46. };
  47. DefaultProcessor.prototype.displayPendingSpec = function (spec) {
  48. return DefaultProcessor.displaySpecDescription(spec);
  49. };
  50. DefaultProcessor.prototype.displayErrorMessages = function (spec, stacktraceOption) {
  51. var logs = [];
  52. for (var _i = 0, _a = spec.failedExpectations; _i < _a.length; _i++) {
  53. var failedExpectation = _a[_i];
  54. logs.push(this.theme.failed("- ") + this.theme.failed(failedExpectation.message));
  55. if (stacktraceOption === configuration_1.StacktraceOption.RAW && failedExpectation.stack) {
  56. logs.push(this.configuration.stacktrace.filter(failedExpectation.stack));
  57. }
  58. }
  59. return logs.join("\n");
  60. };
  61. return DefaultProcessor;
  62. }(display_processor_1.DisplayProcessor));
  63. exports.DefaultProcessor = DefaultProcessor;
  64. //# sourceMappingURL=default-processor.js.map