UNPKG

e2ed

Version:

E2E testing framework over Playwright

27 lines (26 loc) 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getUnvisitedTestFilePaths = void 0; const asserts_1 = require("../asserts"); /** * Get unvisited test file paths, that is, file paths to tests for which there was no test runs. * @internal */ const getUnvisitedTestFilePaths = (fullTestRuns, allTestFilePaths, notIncludedInPackTests) => { const visitedTestFilePathsHash = Object.create(null); for (const { filePath } of fullTestRuns) { visitedTestFilePathsHash[filePath] = true; } for (const filePath of notIncludedInPackTests) { (0, asserts_1.assertValueIsFalse)(filePath in visitedTestFilePathsHash, 'There is no duplicate test file path in included and not included in pack tests', { filePath, notIncludedInPackTests }); visitedTestFilePathsHash[filePath] = true; } const unvisitedTestFilePaths = []; for (const filePath of allTestFilePaths) { if (!(filePath in visitedTestFilePathsHash)) { unvisitedTestFilePaths.push(filePath); } } return unvisitedTestFilePaths; }; exports.getUnvisitedTestFilePaths = getUnvisitedTestFilePaths;