Trendyol/jest-testcontainers

add example with postgresql and migration

Closed this issue · 3 comments

we can create an example that showcases how to write integration tests for postgresql.

node-pg-migrate or something else, can be used to manage migrations. should support watch mode.

I am trying to fix in a fork but still cannot get postgres to work with this. The image seems to time out every attempt at running.In my fork, I updated testcontainers-node and modified the config to allow waiting for health checks. I am not sure what is happening or why it times out.

Hey @RipTheJacker,

Can you please link me to your branch that does not work? We currently use this library in multiple projects for PostgreSQL integration testing. I will try to publish a working example this weekend, so you can use it as a reference.

Cheers,
Yengas

Hey @RipTheJacker,

Just published an example project showcasing how to write integration tests for PostgreSQL. It uses node-pg-migrate for the DB migration. It also has CI integration for Github + Gitlab. Tried to keep the example as simple as possible.

You can also check this commit where I add jest-testcontainers to the project.

LMK if you have any more questions or problems integrating this into your project.

Cheers,
Yengas