UNPKG

alsatian

Version:

TypeScript and JavaScript testing framework for beautiful and readable tests

35 lines 1.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const test_item_1 = require("./test-item"); class TestPlan { constructor(testSet) { this._testItems = []; if (testSet.testFixtures.length === 0) { return; } const testFixtures = testSet.testFixtures; const focussedTestsOrTestFixtures = testFixtures.filter(testFixture => testFixture.focussed || testFixture.tests.some(test => test.focussed)).length > 0; testFixtures.forEach(testFixture => { let testsToRun = testFixture.tests; if (focussedTestsOrTestFixtures) { if (testFixture.tests.some(test => test.focussed)) { testsToRun = testFixture.tests.filter(test => test.focussed); } else if (testFixture.focussed === false) { testsToRun = []; } } testsToRun.forEach(test => { test.testCases.forEach(testCase => { this._testItems.push(new test_item_1.TestItem(testFixture, test, testCase)); }); }); }); } get testItems() { return this._testItems; } } exports.TestPlan = TestPlan; //# sourceMappingURL=test-plan.js.map