Skip to content

Commit

Permalink
test: add Wait.forHttp strategy when starting e2e environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Gi-jutsu committed Aug 13, 2024
1 parent 26c68eb commit 7247034
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
context: ../
dockerfile: ./docker/Dockerfile
image: backend
container_name: api-1
env_file:
- ../.env
ports:
Expand Down
5 changes: 5 additions & 0 deletions specs/global-setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
type StartedDockerComposeEnvironment,
DockerComposeEnvironment,
Wait,
} from "testcontainers";

let environment: StartedDockerComposeEnvironment;
Expand All @@ -11,6 +12,10 @@ export async function setup() {
"docker-compose.yaml"
)
.withBuild()
.withWaitStrategy(
"api-1",
Wait.forHttp("/health-check", 8080).forStatusCode(200)
)
.up();
}

Expand Down

0 comments on commit 7247034

Please sign in to comment.