Skip to content

testing: validate both JSON and HCL synth output in core unit tests, not just JSON snapshots #563

Open

Description

@jsteinich

Description

Most unit tests in packages/cdktn/test snapshot JSON synth output. Nothing checks that the output is valid Terraform, and the HCL path is rarely checked at all. Several recent bugs were visible in snapshots or only affected HCL, and none failed a test:

Proposal

Add a shared helper that synthesizes a stack in both modes and runs toBeValidTerraform on each, then use it in the suites that cover core blocks (variables, outputs, locals, backends, lifecycle, moved/import/removed).

References

#313, #452 (toBeValidTerraform fixes), #521 / #559

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions