TGIMBA TypeScript API Tuneup – Step 4 – Complete Set of Local SQL Server Integration Tests

Git  Code

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

Screen Shot 2017-12-22 at 3.37.35 PM

  • Using the container id, restart it
    • docker start a23ff34a2306

Screen Shot 2017-12-22 at 3.37.53 PM

  • 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!))

Screen Shot 2017-12-22 at 3.41.28 PM

  • Run previous test to verify database was set up.

Screen Shot 2017-12-22 at 3.43.46 PM

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):

Screen Shot 2017-12-22 at 10.29.50 PM

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

Screen Shot 2017-12-22 at 10.42.35 PM

Putting it all together:

  • Existing unit tests

Screen Shot 2017-12-22 at 10.12.04 PM

  • Complete (ish) Dynamo Db and SQL Server integration tests

Screen Shot 2017-12-22 at 10.26.00 PM

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 😉 ).

NOTE:  TypeScript without types is JavaScript.  So, I will be adding types for everything…eventually.

Stay tuned!



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s