Stores baseline CloudFormation templates as JSON under test/snapshots/,
named after the sample config file (e.g., sample-config-comprehensive.baseline.json).
When a config produces multiple stacks, each gets its own file:
{configBaseName}.{stackName}.baseline.json.
Docker-related Lambda Code.from* methods are mocked to prevent Docker
invocation during synth.
Only resource and output differences are considered failures. Metadata,
input parameters, conditions, and mappings are ignored.
The test also fails, without writing or updating any baseline, if synth leaves
an error annotation on any construct (e.g. an unsuppressed cdk-nag finding),
since cdk synth would reject the same app.
Baseline diff test using the CDK Toolkit Library.
Stores baseline CloudFormation templates as JSON under test/snapshots/, named after the sample config file (e.g., sample-config-comprehensive.baseline.json). When a config produces multiple stacks, each gets its own file: {configBaseName}.{stackName}.baseline.json.
Docker-related Lambda Code.from* methods are mocked to prevent Docker invocation during synth.
Only resource and output differences are considered failures. Metadata, input parameters, conditions, and mappings are ignored.
The test also fails, without writing or updating any baseline, if synth leaves an error annotation on any construct (e.g. an unsuppressed cdk-nag finding), since
cdk synthwould reject the same app.