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.
Mitigates #35
Assume we are running as a unit test when
process.mainModule
isundefined
. This case happens when the node application is not invoked directly withnode
, 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.