concept
Mock providers and negative tests
Use expected failures and mock results to test module contracts.
Formal Syntax & Structure
terraform syntaxterraform
Mock providers and negative testsWorking Example
Example Snippetterraform
run "reject_zero" { command = plan variables { replicas = 0 } expect_failures = [var.replicas]}run "reject_fraction" { command = plan variables { replicas = 1.5 } expect_failures = [var.replicas]}