testplane
Version:
Tests framework based on mocha and wdio
28 lines • 1.69 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.mergeSelectivityDumps = void 0;
const fs_extra_1 = __importDefault(require("fs-extra"));
const path_1 = __importDefault(require("path"));
const merge_hashes_1 = require("./merge-hashes");
const merge_tests_1 = require("./merge-tests");
const mergeSelectivityDumps = async (destPath, sourcePaths, preferredCompression) => {
const destAbsolutePath = path_1.default.resolve(destPath);
const srcAbsolutePaths = sourcePaths.map(sourcePath => path_1.default.resolve(sourcePath));
await fs_extra_1.default.ensureDir(destAbsolutePath);
await fs_extra_1.default.promises.access(destAbsolutePath, fs_extra_1.default.constants.W_OK).catch(cause => {
throw new Error(`Couldn't get write access to destination directory "${destAbsolutePath}"`, { cause });
});
await Promise.all(srcAbsolutePaths.map(srcAbsolutePath => {
return fs_extra_1.default.promises.access(srcAbsolutePath, fs_extra_1.default.constants.R_OK).catch(cause => {
throw new Error(`Couldn't get read access to source directory "${srcAbsolutePath}"`, { cause });
});
}));
await (0, merge_hashes_1.mergeHashes)(destAbsolutePath, srcAbsolutePaths, preferredCompression);
await (0, merge_tests_1.mergeTests)(destAbsolutePath, srcAbsolutePaths, preferredCompression);
console.info(`Successfully merged selectivity dumps into "${destAbsolutePath}"`);
};
exports.mergeSelectivityDumps = mergeSelectivityDumps;
//# sourceMappingURL=index.js.map