ivr-tester
Version:
An automated testing framework for IVR call flows
19 lines (18 loc) • 617 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IteratingTestAssigner = void 0;
class IteratingTestAssigner {
constructor(scenarios) {
this.scenarios = scenarios;
this.testIterator = scenarios.entries();
}
assign() {
const testEntry = this.testIterator.next();
if (!testEntry.done) {
const [, test] = testEntry.value;
return { isAssigned: true, scenario: test };
}
return { isAssigned: false, reason: "All tests already assigned" };
}
}
exports.IteratingTestAssigner = IteratingTestAssigner;