dockest
Version:
Dockest is an integration testing tool aimed at alleviating the process of evaluating unit tests whilst running multi-container Docker applications.
15 lines • 891 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.withNoStop = void 0;
const rxjs_1 = require("rxjs");
const operators_1 = require("rxjs/operators");
const errors_1 = require("../errors");
const create_docker_event_emitter_1 = require("../run/bootstrap/create-docker-event-emitter");
/**
* The wrapped readiness check will fail if the container dies or gets killed.
*/
const withNoStop = (input) => (args) => (0, rxjs_1.race)((0, rxjs_1.from)(input(args)), args.runner.dockerEventStream$.pipe((0, operators_1.filter)((event) => (0, create_docker_event_emitter_1.isDieEvent)(event) || (0, create_docker_event_emitter_1.isKillEvent)(event)), (0, operators_1.map)((event) => {
throw new errors_1.DockestError('Container unexpectedly died.', { runner: args.runner, event });
})));
exports.withNoStop = withNoStop;
//# sourceMappingURL=with-no-stop.js.map