npm @testcontainers/mongodb 12.0.0
v12.0.0

3 hours ago

๐Ÿšจ Breaking Changes

  1. Node 20 is EOL. Minimum engine requirement is now >= 22.22, matching the constraints from our dependencies.

  2. Previously, when no wait strategy was configured, Testcontainers defaulted to Wait.forListeningPorts().

    The new default wait strategy uses a Docker healthcheck when one is configured on the container image or service, falling back to Wait.forListeningPorts() when no healthcheck is available.

    To keep the previous behaviour, configure Wait.forListeningPorts() explicitly:

    import { DockerComposeEnvironment, GenericContainer, Wait } from "testcontainers";
    
    // Container: opt back into the previous default of waiting for listening ports
    const container = await new GenericContainer("my-image:latest")
      .withExposedPorts(8080)
      .withWaitStrategy(Wait.forListeningPorts())
      .start();
    
    // Compose: apply the previous default to all services
    const environment = await new DockerComposeEnvironment(composeFilePath, "docker-compose.yml")
      .withDefaultWaitStrategy(Wait.forListeningPorts())
      .up();
    
    // Compose: or apply it to a specific compose container
    const environment = await new DockerComposeEnvironment(composeFilePath, "docker-compose.yml")
      .withWaitStrategy("api-1", Wait.forListeningPorts())
      .up();

Changes

๐Ÿš€ Features

  • Use configured health checks as the default wait strategy @digital88 (#1096)

๐Ÿ› Bug Fixes

๐Ÿ“– Documentation

๐Ÿงน Maintenance

๐Ÿ“ฆ Dependency Updates

Don't miss a new mongodb release

NewReleases is sending notifications on new releases.