GetTestMongoDBContainer is a helper function for tests that creates a MongoDB container and handles the error by failing the test if container creation fails
(ctx context.Context, t testing.TB)
| 605 | // GetTestMongoDBContainer is a helper function for tests that creates a MongoDB container |
| 606 | // and handles the error by failing the test if container creation fails |
| 607 | func GetTestMongoDBContainer(ctx context.Context, t testing.TB) *MongoDBContainer { |
| 608 | t.Helper() |
| 609 | container, err := GetMongoDBContainer(ctx) |
| 610 | if err != nil { |
| 611 | t.Fatalf("failed to create MongoDB container: %v", err) |
| 612 | } |
| 613 | return container |
| 614 | } |