You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why did it take a few seconds? Because your container runtime likely had to pull the image first. If you run the test again, it'll likely pass much faster.
55
+
Why did it take a few seconds? Because your container runtime likely had to pull the image first. If you run the test again, it'll run faster.
56
+
57
+
## Global setup
58
+
59
+
If you have a lot of tests that require a Redis container, you might not want to spin up 100s of Redis containers.
60
+
61
+
In this case a common pattern is to set the container up globally, and reuse it in your tests. Here's an example using Vitest:
const result =awaitglobalThis.redisClient.get("key");
107
+
expect(result).toBe("test-value");
108
+
});
109
+
```
110
+
111
+
## Logging
50
112
51
113
It would be nice to see what Testcontainers is doing while the test is running. You can enable all debug logging by setting the `DEBUG` environment variable. For example:
0 commit comments