@angular-devkit/build-angular
Version:
Angular Webpack Build Facade
32 lines • 1.29 kB
JavaScript
;
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.findTestFiles = findTestFiles;
const tinyglobby_1 = require("tinyglobby");
/**
* Finds all test files in the project.
*
* @param options The builder options describing where to find tests.
* @param workspaceRoot The path to the root directory of the workspace.
* @param glob A promisified implementation of the `glob` module. Only intended for
* testing purposes.
* @returns A set of all test files in the project.
*/
async function findTestFiles(include, exclude, workspaceRoot, glob = tinyglobby_1.glob) {
const globOptions = {
cwd: workspaceRoot,
ignore: ['node_modules/**'].concat(exclude),
braceExpansion: false, // Do not expand `a{b,c}` to `ab,ac`.
extglob: false, // Disable "extglob" patterns.
};
const included = await Promise.all(include.map((pattern) => glob(pattern, globOptions)));
// Flatten and deduplicate any files found in multiple include patterns.
return new Set(included.flat());
}
//# sourceMappingURL=test-files.js.map