element.version === currentVersion)) { versionNodes.unshift({ version: currentVersion, url: "#" }); } document.querySelector("#project-version").innerHTML = versionNodes.reduce( (acc, element) => { const status = currentVersion === element.version ? "selected disabled" : ""; return ` ${acc} `; }, `
testcontainer_formulas · v1.0.0

testcontainer_formulas

testcontainer_formulas

Hex Package Hex Docs CI License

Ready-to-use formulas for testcontainer with typed outputs.

Each formula gives you sensible defaults plus a rich record (for example PostgresContainer with connection_url, host, port) so tests do not rebuild connection strings manually.

Install

gleam add testcontainer
gleam add testcontainer_formulas

Quick example

import testcontainer
import testcontainer_formulas/postgres

pub fn user_repository_test() {
  use pg <- testcontainer.with_formula(
    postgres.new()
    |> postgres.with_database("myapp_test")
    |> postgres.with_password("secret")
    |> postgres.formula(),
  )

  let _ = pg.connection_url
  Ok(Nil)
}

Available formulas

  • testcontainer_formulas/mongo
  • testcontainer_formulas/mysql
  • testcontainer_formulas/postgres
  • testcontainer_formulas/rabbitmq
  • testcontainer_formulas/redis

Documentation

License

MIT.

Search Document