Welcome back to the next step in the TGIMBA Typescript Node JS API Tune up. In this blog post, I will complete the SQL Server integration tests using the docker container setup previously.
Before adding the rest of the integration tests, I restarted and verified that the local SQL Server docket container was working. Specifically:
- List all docker containers to find the SQL Server container previously setup
- docker ps -a
- Using the container id, restart it
- docker start a23ff34a2306
- Change the SQL Server config to point to localhost (you can use your current IP, but that doesn’t work when you are not connected to the internet (as I discovered writing this on our trip to New York in the car…doh!))
- Run previous test to verify database was set up.
To complete the SQL Server Integration tests, I have added the one big test to the code from my last post (i.e. setup of the bucket list database in the SQL Server docker images):
This test is made up of the following steps:
- a user can be registered
- a user can be logged in
- a user can add a bucket list item
- a user can retreive the added bucket list item
- a user can update the added bucket list item
- a user can verify that the updated bucket list was updated
- a user can delete a bucket list item
Putting it all together:
- Existing unit tests
- Complete (ish) Dynamo Db and SQL Server integration tests
Next step will be a combined post showing Dynamo Db and SQL Server self-contained docker containers so they can be run in the AWS code pipeline (or separate posts…depends how ambitious I am this week 😉 ).