UNPKG

@testcontainers/gcloud

Version:
30 lines 1.33 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StartedDatastoreEmulatorContainer = exports.DatastoreEmulatorContainer = void 0; const testcontainers_1 = require("testcontainers"); const abstract_gcloud_emulator_1 = require("./abstract-gcloud-emulator"); const EMULATOR_PORT = 8080; class DatastoreEmulatorContainer extends abstract_gcloud_emulator_1.AbstractGcloudEmulator { constructor(image) { super(image, EMULATOR_PORT, "gcloud beta emulators firestore start"); this.withFlag("database-mode", `datastore-mode`); } async start() { return new StartedDatastoreEmulatorContainer(await super.start()); } } exports.DatastoreEmulatorContainer = DatastoreEmulatorContainer; class StartedDatastoreEmulatorContainer extends testcontainers_1.AbstractStartedContainer { constructor(startedTestContainer) { super(startedTestContainer); } /** * @return a <code>host:port</code> pair corresponding to the address on which the emulator is * reachable from the test host machine. */ getEmulatorEndpoint() { return `${this.getHost()}:${this.getMappedPort(EMULATOR_PORT)}`; } } exports.StartedDatastoreEmulatorContainer = StartedDatastoreEmulatorContainer; //# sourceMappingURL=datastore-emulator-container.js.map