ts-budgie
Version:
Converts TypeScript code to Budgie.
25 lines • 1.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var fs = require("fs");
var path = require("path");
var findBudgieFilesUnder_1 = require("./findBudgieFilesUnder");
/**
* Retrieves, for each command in a directory, tests under that command.
*
* @param rootPath An absolute path to a command's tests folder.
* @param inclusions Command groups to run, if not all.
* @returns Tests for each command in a directory.
*/
exports.findBudgieTestSourcesUnder = function (rootPath, inclusions) {
var childrenNames = findBudgieFilesUnder_1.findBudgieFilesUnder(rootPath, inclusions);
var tests = new Map();
for (var _i = 0, childrenNames_1 = childrenNames; _i < childrenNames_1.length; _i++) {
var childName = childrenNames_1[_i];
tests.set(childName, fs
.readdirSync(path.resolve(rootPath, childName))
.filter(function (testFileName) { return testFileName.indexOf(".bg") !== -1; })
.map(function (testFileName) { return testFileName.substring(0, testFileName.indexOf(".bg")); }));
}
return tests;
};
//# sourceMappingURL=findBudgieTestSourcesUnder.js.map