e2ed
Version:
E2E testing framework over Playwright
25 lines (24 loc) • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.collectTestFilePaths = void 0;
const promises_1 = require("node:fs/promises");
const node_path_1 = require("node:path");
const internal_1 = require("../../constants/internal");
const config_1 = require("../config");
/**
* Collects all test file paths for current pack by test file globs
* (includes tests that will be filtered by the `filterTestsIntoPack` function).
* @internal
*/
const collectTestFilePaths = async () => {
const { testFileGlobs } = (0, config_1.getFullPackConfig)();
const rawTestFilesPaths = [];
for await (const directory of (0, promises_1.glob)(testFileGlobs)) {
rawTestFilesPaths.push(directory);
}
const testFilesPaths = rawTestFilesPaths
.map(node_path_1.normalize)
.filter((testFilePath) => testFilePath.startsWith(internal_1.TESTS_DIRECTORY_PATH) && !testFilePath.endsWith('.skip.ts'));
return testFilesPaths;
};
exports.collectTestFilePaths = collectTestFilePaths;