Running the tests
This chapter’s code comes with a few fine-grained tests and snapshot tests preconfigured so that you can go through the exercise of running these tests. These tests are by no means exhaustive (meaning covering all the functionality) and this might not be the optimal way to configure tests in your project. However, hopefully, this will inspire you to improve. Let’s take a look at how to run this chapter’s tests.
Configuring the environments
Just like in the previous chapter, when we were running our CDK stack for various environments, we need to create a .env
file in the infrastructure
directory of chapter 6
to pass some values about the deployment to test the stack. We will name this file .env.testing
so that it only gets picked up when we are running the tests. So, go ahead and create a .env.testing
file under the infrastructure
directory and fill it with values similar to the ones in the Chapter 5 .
env
files:
CDK_DEFAULT_ACCOUNT=<...