Skip to main content
Home

Built and signed on GitHub Actions

Test container solution for running third party solutions through docker.

This package works with Deno
This package works with Deno
JSR Score
76%
Published
4 months ago (2.0.2)
class MongoTestContainer

Provides a simplified utility layer for starting, operating, and shutting down a postgres docker container.

Will automatically pull the requested docker image before starting the container.

Constructors

new
MongoTestContainer(
container: Container,
connection: MongoConnectionInfo,
)

Properties

readonly
exec: this.container.exec

Execute a command in the Mongo container.

readonly
host: string

MongoDb container host.

readonly
password: string

MongoDb password applied to the container.

readonly
port: number

MongoDb container port.

readonly
username: string

MongoDb username applied to the container.

Methods

stop(): Promise<void>

Stop and remove the Mongo container.

Return the connection URL for the Mongo container in the format: mongodb://${user}:${pass}@${host}:${port}.

Make sure to start the container before accessing this method or it will throw an error.

Static Methods

Start a new Mongo container.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@valkyr/testcontainers

Import symbol

import { MongoTestContainer } from "@valkyr/testcontainers/mongodb";
or

Import directly with a jsr specifier

import { MongoTestContainer } from "jsr:@valkyr/testcontainers/mongodb";