@testcontainers/arangodb
Version:
ArangoDB module for Testcontainers
48 lines • 1.63 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.StartedArangoContainer = exports.ArangoDBContainer = void 0;
const testcontainers_1 = require("testcontainers");
const ARANGODB_PORT = 8529;
const USERNAME = "root";
class ArangoDBContainer extends testcontainers_1.GenericContainer {
password;
constructor(image, password = "test") {
super(image);
this.password = password;
this.withExposedPorts(ARANGODB_PORT).withWaitStrategy(testcontainers_1.Wait.forLogMessage("Have fun!")).withStartupTimeout(120_000);
}
withPassword(password) {
this.password = password;
return this;
}
async start() {
this.withEnvironment({ ARANGO_ROOT_PASSWORD: this.password });
return new StartedArangoContainer(await super.start(), this.password);
}
}
exports.ArangoDBContainer = ArangoDBContainer;
class StartedArangoContainer extends testcontainers_1.AbstractStartedContainer {
password;
host;
port;
constructor(startedTestContainer, password) {
super(startedTestContainer);
this.password = password;
this.host = this.startedTestContainer.getHost();
this.port = this.startedTestContainer.getMappedPort(ARANGODB_PORT);
}
getTcpUrl() {
return `tcp://${this.host}:${this.port}/`;
}
getHttpUrl() {
return `http://${this.host}:${this.port}/`;
}
getPassword() {
return this.password;
}
getUsername() {
return USERNAME;
}
}
exports.StartedArangoContainer = StartedArangoContainer;
//# sourceMappingURL=arangodb-container.js.map