all files / core/ test-set.js

100% Statements 23/23
100% Branches 4/4
100% Functions 7/7
100% Lines 23/23
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 35 36 37 38 39 40      57×             53×                
"use strict";
var path = require("path");
var TestSet = (function () {
    function TestSet(_testLoader, _globHelper) {
        this._testLoader = _testLoader;
        this._globHelper = _globHelper;
        this._testFixtures = [];
    }
    Object.defineProperty(TestSet.prototype, "testFixtures", {
        get: function () {
            return this._testFixtures;
        },
        enumerable: true,
        configurable: true
    });
    TestSet.prototype.addTestsFromFiles = function (testsFileLocations) {
        if (typeof testsFileLocations === "string") {
            testsFileLocations = [testsFileLocations];
        }
        this._loadTestFixtures(testsFileLocations);
    };
    TestSet.prototype._loadTestFixtures = function (testFileLocations) {
        var _this = this;
        testFileLocations.forEach(function (testFileLocation) {
            testFileLocation = path.join(process.cwd(), testFileLocation);
            if (_this._globHelper.isGlob(testFileLocation)) {
                var physicalTestFileLocations = _this._globHelper.resolve(testFileLocation);
                physicalTestFileLocations.forEach(function (physicalTestFileLocation) {
                    _this._testFixtures = _this.testFixtures.concat(_this._testLoader.loadTestFixture(physicalTestFileLocation));
                });
            }
            else {
                _this._testFixtures = _this.testFixtures.concat(_this._testLoader.loadTestFixture(testFileLocation));
            }
        });
    };
    return TestSet;
}());
exports.TestSet = TestSet;
//# sourceMappingURL=test-set.js.map