@brillout/test-e2e 0.5.27 → 0.5.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,14 +6,19 @@ const parallel_ci_1 = require("./parallel-ci");
6
6
  // Unit tests `**/*.spec.*` are handled by Vitest
7
7
  const testFilenamePattern = '**/*.test.ts';
8
8
  async function findTestFiles(findFilter) {
9
+ const testFilesAll = await findTestFilesAll();
10
+ const testFiles = (0, utils_1.filterFiles)(testFilesAll, findFilter);
11
+ return testFiles;
12
+ }
13
+ exports.findTestFiles = findTestFiles;
14
+ async function findTestFilesAll() {
9
15
  {
10
16
  const testFiles = (0, parallel_ci_1.getTestFilesForCurrentJob)();
11
17
  if (testFiles)
12
18
  return testFiles;
13
19
  }
14
20
  {
15
- const testFiles = (0, utils_1.findFiles)(testFilenamePattern, findFilter);
21
+ const testFiles = (0, utils_1.findFiles)(testFilenamePattern);
16
22
  return testFiles;
17
23
  }
18
24
  }
19
- exports.findTestFiles = findTestFiles;
@@ -1,9 +1,11 @@
1
1
  export { findFiles };
2
2
  export { findFilesParseCliArgs };
3
+ export { filterFiles };
3
4
  export type { FindFilter };
4
5
  declare type FindFilter = {
5
6
  terms: string[];
6
7
  exclude: boolean;
7
8
  };
8
- declare function findFiles(pattern: string, findFilter: null | FindFilter): Promise<string[]>;
9
+ declare function findFiles(pattern: string): Promise<string[]>;
10
+ declare function filterFiles(files: string[], findFilter: null | FindFilter): string[];
9
11
  declare function findFilesParseCliArgs(): null | FindFilter;
@@ -3,20 +3,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.findFilesParseCliArgs = exports.findFiles = void 0;
6
+ exports.filterFiles = exports.findFilesParseCliArgs = exports.findFiles = void 0;
7
7
  const fast_glob_1 = __importDefault(require("fast-glob"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const runCommandShortLived_1 = require("./runCommandShortLived");
10
10
  const cwd = process.cwd();
11
11
  let gitFiles;
12
- async function findFiles(pattern, findFilter) {
13
- let files = (await (0, fast_glob_1.default)([pattern], { ignore: ['**/node_modules/**', '**/.git/**'], cwd, dot: true }))
14
- .filter((filePathRelative) => applyFilter(filePathRelative, findFilter))
15
- .map((filePathRelative) => path_1.default.join(cwd, filePathRelative));
12
+ async function findFiles(pattern) {
13
+ let files = (await (0, fast_glob_1.default)([pattern], { ignore: ['**/node_modules/**', '**/.git/**'], cwd, dot: true })).map((filePathRelative) => path_1.default.join(cwd, filePathRelative));
16
14
  files = await filterGitIgnoredFiles(files);
17
15
  return files;
18
16
  }
19
17
  exports.findFiles = findFiles;
18
+ function filterFiles(files, findFilter) {
19
+ return files
20
+ .map((p) => path_1.default.relative(cwd, p))
21
+ .filter((filePathRelative) => applyFilter(filePathRelative, findFilter))
22
+ .map((p) => path_1.default.join(cwd, p));
23
+ }
24
+ exports.filterFiles = filterFiles;
20
25
  async function filterGitIgnoredFiles(files) {
21
26
  if (!gitFiles) {
22
27
  const stdout1 = await (0, runCommandShortLived_1.runCommandShortLived)('git ls-files', { cwd });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/test-e2e",
3
- "version": "0.5.27",
3
+ "version": "0.5.28",
4
4
  "bin": "./bin.js",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {