Assert package doesn't synthesize the stack
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- aws, typescript
- Domain
- documentation, testing
Research direction
Start with the Fine-grained Assertions section in doc_source/testing.md and reproduce the example using a custom Stack, moving resource creation inside the stack as described. Compare the matcher input with the SynthUtils.toCloudFormation(MyStack) example; done means the documentation clearly reflects the real-world test setup and the assertion reports the expected resources.
Written by the indexing model from the issue text.
Description
If you follow the documentation for Fine-grained Assertions - the test will pass.
It's not a real-world scenario though - you don't create a resource in a test, you create the resource in the stack definition.
If you modify the test and move new dlq.DeadLetterQueue(...) inside of the new Stack() call (assuming new Stack() is a custom stack like export class MyStack extends Stack { ... }, the test will fail and indicate that there are 0 resources.
You can fix this error by adding a line; const stackTemplate = SynthUtils.toCloudFormation(new MyStack()) and passing the stackTemplate variable to the expect(...) call instead of the stack variable.
I'm not sure if this is a bug with the jest matcher though, or whether this fix is the right approach and the documentation just isn't quite matching up to a real-world scenario?
- Dominant language
- Perl
- Stars
- 360
- Forks
- 230
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from awsdocs/aws-cdk-guide
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
awsdocs/aws-cdk-guide#495 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
awsdocs/aws-cdk-guide#435 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
awsdocs/aws-cdk-guide#439 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
awsdocs/aws-cdk-guide#437 ·
-
Difficulty 2/5 Half a day Newbie friendliness 35/100
awsdocs/aws-cdk-guide#420 ·
All issues in awsdocs/aws-cdk-guide
Similar issues
-
"Chia" category expects a single and specific ingredient but doesn't recognize "Salvia Hispanica"Open
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
openfoodfacts/openfoodfacts-server#15362 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
RotherOSS/servicecatalog#30 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100