@birthdayresearch/sticky-testcontainers
TypeScript icon, indicating that this package has built-in type declarations

0.8.5 • Public • Published

Test Containers

@birthdayresearch/sticky-testcontainers

Providing opinionated containers that follows the testcontainers-node Fluent API design.

  • PostgreSqlContainer - for a Postgres database docker container
  • LocalstackContainer - for a Localstack cloud docker container
  • RedisContainer - for a Redis docker container

Example with PostgresSqlContainer:

import { PostgreSqlContainer, StartedPostgreSqlContainer } from '@birthdayresearch/sticky-testcontainers';

let postgres: StartedPostgreSqlContainer;

beforeAll(async () => {
  postgres = await new PostgreSqlContainer().start();
});

afterAll(async () => {
  await postgres.stop();
});

With network:

import { PostgreSqlContainer, RedisContainer, Network } from '@birthdayresearch/sticky-testcontainers';

beforeAll(async () => {
  const network = await new Network().start();
  const postgres = await new PostgreSqlContainer().withNetwork(network).start();
  const redis = await new RedisContainer().withNetwork(network).start();
});

afterAll(async () => {
  await postgres.stop();
  await redis.stop();
  await network.stop();
});

Readme

Keywords

none

Package Sidebar

Install

npm i @birthdayresearch/sticky-testcontainers

Weekly Downloads

0

Version

0.8.5

License

none

Unpacked Size

17.9 kB

Total Files

19

Last publish

Collaborators

  • birthdayresearch-npm-bot
  • fuxingloh