chore: migrate more modules to jest#16533
chore: migrate more modules to jest#16533mergify[bot] merged 3 commits intoaws:masterfrom kaizencc:jest-migrate-2
Conversation
| // THEN - stack does not contain a LaunchConfiguration | ||
| const template = SynthUtils.synthesize(stack, { skipValidation: true }); | ||
| expect(template).not.toHaveResource('AWS::AutoScaling::LaunchConfiguration'); | ||
| expect(() => SynthUtils.synthesize(stack)).toThrow(); |
There was a problem hiding this comment.
@nija-at I'd like a second pair of eyes on this test (there are 2 other tests with the same pattern as well). It is comparable to this test in nodeunit:
aws-cdk/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s-v2.ts
Lines 270 to 273 in c6c5941
The issue in question is the use of expect(stack, true) as the true refers to setting skipValidation=true. Without it, the test returns a validation error and we cannot check if the stack contains LaunchConfiguration or not. Since the Jest expect() function does not allow this, I dove in and found SynthUtils.synthesize exposes such an option.
I'm not sure if this is the best way to go about this so I wanted to bring it to your attention.
There was a problem hiding this comment.
Hey Kaizen. This is fine for now.
When we migrate this module to 'assertions', we will need to make the validation succeed.
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Migrates
aws-ecs-patternsandaws-sqstojest.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license