This PR makes a couple of changes to how we're testing CDK changes:
Firstly, this adds a test step to the CI workflow. Previously changes could be made to the CDK template and CI would pass without having updated the jest snapshot. Adding this step to CI will ensure that we're updating the snapshot when raising a PR. This will help us to have more confidence that we're making the infrastructure changes we intend to, and will enable PR reviewers to more easily see what changes are being made. I have also added a test:update npm script to make it easier to update the jest snapshot.
Secondly, this adds a noEmit flag to the typescript compiler config to prevent the compiler from outputting any transpiled javascript code. I was getting an error when trying to update the jest snapshot as it was comparing to generated javascript files rather than typescript files.
This PR also includes an updated jest snapshot, as it was out of date.
How to test
This can be tested by:
running the branch locally
making changes to a CDK dependency
running yarn run test to watch the test fail
running yarn run test:update to update the jest snapshot and pass the test
To check that CDK is being tested as part of CI, you can view the cdk synth step in the logs for this branch here.
What does this change?
This PR makes a couple of changes to how we're testing CDK changes:
Firstly, this adds a test step to the CI workflow. Previously changes could be made to the CDK template and CI would pass without having updated the jest snapshot. Adding this step to CI will ensure that we're updating the snapshot when raising a PR. This will help us to have more confidence that we're making the infrastructure changes we intend to, and will enable PR reviewers to more easily see what changes are being made. I have also added a
test:update
npm script to make it easier to update the jest snapshot.Secondly, this adds a
noEmit
flag to the typescript compiler config to prevent the compiler from outputting any transpiled javascript code. I was getting an error when trying to update the jest snapshot as it was comparing to generated javascript files rather than typescript files.This PR also includes an updated jest snapshot, as it was out of date.
How to test
This can be tested by:
yarn run test
to watch the test failyarn run test:update
to update the jest snapshot and pass the testTo check that CDK is being tested as part of CI, you can view the
cdk synth
step in the logs for this branch here.