testplane
Version:
Tests framework based on mocha and wdio
25 lines • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getUsedDumpsTracker = exports.UsedDumpsTracker = void 0;
const lodash_1 = require("lodash");
class UsedDumpsTracker {
constructor() {
this._usedDumpsPerSelectivityRoot = {};
}
trackUsed(dumpId, testDependenciesPath) {
this._usedDumpsPerSelectivityRoot[testDependenciesPath] ||= new Set();
this._usedDumpsPerSelectivityRoot[testDependenciesPath].add(dumpId);
}
usedDumpsFor(testDependenciesPath) {
if (!this._usedDumpsPerSelectivityRoot[testDependenciesPath]) {
return false;
}
return Boolean(this._usedDumpsPerSelectivityRoot[testDependenciesPath].size);
}
wasUsed(dumpId, testDependenciesPath) {
return this._usedDumpsPerSelectivityRoot[testDependenciesPath]?.has(dumpId) || false;
}
}
exports.UsedDumpsTracker = UsedDumpsTracker;
exports.getUsedDumpsTracker = (0, lodash_1.once)(() => new UsedDumpsTracker());
//# sourceMappingURL=used-dumps-tracker.js.map