all files / core/results/ test-results.js

100% Statements 22/22
100% Branches 6/6
100% Functions 5/5
100% Lines 21/21
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34  1180× 1180×     1700× 524× 27×   497× 24×   473× 468×           5283× 5283× 5283×      
"use strict";
var test_case_result_1 = require("./test-case-result");
var test_outcome_1 = require("./test-outcome");
var TestResults = (function () {
    function TestResults(_test) {
        this._test = _test;
        this._testCaseResults = [];
    }
    Object.defineProperty(TestResults.prototype, "outcome", {
        get: function () {
            var outcomes = this._testCaseResults.map(function (testCaseResult) { return testCaseResult.outcome; });
            if (outcomes.indexOf(test_outcome_1.TestOutcome.Error) !== -1) {
                return test_outcome_1.TestOutcome.Error;
            }
            if (outcomes.indexOf(test_outcome_1.TestOutcome.Fail) !== -1) {
                return test_outcome_1.TestOutcome.Fail;
            }
            if (outcomes.indexOf(test_outcome_1.TestOutcome.Pass) !== -1) {
                return test_outcome_1.TestOutcome.Pass;
            }
            return test_outcome_1.TestOutcome.Skip;
        },
        enumerable: true,
        configurable: true
    });
    TestResults.prototype.addTestCaseResult = function (args, error) {
        var testCaseResult = new test_case_result_1.TestCaseResult(this._test, args, error);
        this._testCaseResults.push(testCaseResult);
        return testCaseResult;
    };
    return TestResults;
}());
exports.TestResults = TestResults;
//# sourceMappingURL=test-results.js.map