@applitools/eyes
Version:
50 lines (49 loc) • 2.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestResultsSummaryData = void 0;
const TestResultContainer_1 = require("./TestResultContainer");
class TestResultsSummaryData {
/** @internal */
constructor(options) {
this._summary = options === null || options === void 0 ? void 0 : options.summary;
this._core = options === null || options === void 0 ? void 0 : options.core;
}
getAllResults() {
var _a, _b;
return ((_b = (_a = this._summary) === null || _a === void 0 ? void 0 : _a.results.map(container => {
return new TestResultContainer_1.TestResultContainerData({ container, core: this._core });
})) !== null && _b !== void 0 ? _b : []);
}
[Symbol.iterator]() {
var _a, _b;
return ((_b = (_a = this._summary) === null || _a === void 0 ? void 0 : _a.results.map(container => {
return new TestResultContainer_1.TestResultContainerData({ container, core: this._core });
})[Symbol.iterator]()) !== null && _b !== void 0 ? _b : [][Symbol.iterator]());
}
/** @internal */
toJSON() {
var _a, _b;
return (_b = (_a = this._summary) === null || _a === void 0 ? void 0 : _a.results) !== null && _b !== void 0 ? _b : [];
}
/** @internal */
toString() {
var _a, _b, _c, _d, _e, _f, _g;
return ('result summary {' +
'\n\tpassed=' +
((_a = this._summary) === null || _a === void 0 ? void 0 : _a.passed) +
'\n\tunresolved=' +
((_b = this._summary) === null || _b === void 0 ? void 0 : _b.unresolved) +
'\n\tfailed=' +
((_c = this._summary) === null || _c === void 0 ? void 0 : _c.failed) +
'\n\texceptions=' +
((_d = this._summary) === null || _d === void 0 ? void 0 : _d.exceptions) +
'\n\tmismatches=' +
((_e = this._summary) === null || _e === void 0 ? void 0 : _e.mismatches) +
'\n\tmissing=' +
((_f = this._summary) === null || _f === void 0 ? void 0 : _f.missing) +
'\n\tmatches=' +
((_g = this._summary) === null || _g === void 0 ? void 0 : _g.matches) +
'\n}');
}
}
exports.TestResultsSummaryData = TestResultsSummaryData;