@testcontainers/scylladb
Version:
ScyllaDB module for Testcontainers
38 lines • 1.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.StartedScyllaContainer = exports.ScyllaContainer = void 0;
const testcontainers_1 = require("testcontainers");
const SCYLLA_PORT = 9042;
class ScyllaContainer extends testcontainers_1.GenericContainer {
constructor(image) {
super(image);
this.withExposedPorts(SCYLLA_PORT);
this.withCommand(["--skip-wait-for-gossip-to-settle=0"]);
}
async start() {
this.withEnvironment({
SCYLLA_LISTEN_ADDRESS: "0.0.0.0",
SCYLLA_BROADCAST_ADDRESS: "0.0.0.0",
SCYLLA_RPC_ADDRESS: "0.0.0.0",
});
const startedContainer = await super.start();
return new StartedScyllaContainer(startedContainer);
}
}
exports.ScyllaContainer = ScyllaContainer;
class StartedScyllaContainer extends testcontainers_1.AbstractStartedContainer {
constructor(startedTestContainer) {
super(startedTestContainer);
}
getPort() {
return this.startedTestContainer.getMappedPort(SCYLLA_PORT);
}
getDatacenter() {
return "datacenter1"; // Forced in docker.
}
getContactPoint() {
return `${this.getHost()}:${this.getPort()}`;
}
}
exports.StartedScyllaContainer = StartedScyllaContainer;
//# sourceMappingURL=scylladb-container.js.map