sam-goodwin / punchcard

Type-safe AWS infrastructure.
Apache License 2.0
507 stars 20 forks source link

fix(runtime) support snapshot testing #38

Closed sam-goodwin closed 5 years ago

sam-goodwin commented 5 years ago

Mitigates #35

Assume we are running as a unit test when process.mainModule is undefined. This case happens when the node application is not invoked directly with node, usually when the app is loaded from a unit test. Luckily, the CDK invokes the app as an ordinary node process.

This change unblocks snapshot testing - so I also added snapshot tests to detect regressions in the CloudFormation stacks of the example apps.

Would still like to find a better solution.

sam-goodwin commented 5 years ago

Tracking the unfortunate dependency on babel here https://github.com/sam-goodwin/punchcard/issues/40