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
3 months ago (2.0.2)

Test Containers

Test container solution for running third party solutions through docker.

Quick Start

We have quick start support for postgres and mongodb.

Postgres

import { PostgresTestContainer } from "@valkyr/testcontainers/postgres";

const container = await PostgresTestContainer.start("postgres:16");

await container.create("db");
await container.client("db")`SELECT 1`;

console.log(container.url("db")); // => postgres://postgres:postgres@127.0.0.1:5432/db

await container.stop();

MongoDB

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

const container = await MongoTestContainer.start();

console.log(container.url()); // mongodb://user:pass@127.0.0.1:27017
console.log(await container.client.db("admin").command({ ping: 1 })); // { ok: 1 }

await container.stop();
Built and signed on
GitHub Actions

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 * as testcontainers from "@valkyr/testcontainers";
or

Import directly with a jsr specifier

import * as testcontainers from "jsr:@valkyr/testcontainers";