An example of writing mock-based unit tests with both infrastructure definition and tests written in TypeScript. The example uses the Mocha test framework to define and run the tests.
-
Restore NPM dependencies:
$ npm install
-
Run the tests:
$ PULUMI_TEST_MODE=true \ PULUMI_NODEJS_STACK="my-ws" \ PULUMI_NODEJS_PROJECT="dev" \ PULUMI_CONFIG='{ "aws:region": "us-west-2" }' \ mocha -r ts-node/register ec2tests.ts Infrastructure #server ✓ must have a name tag ✓ must not use userData (use an AMI instead) #group ✓ must not open port 22 (SSH) to the Internet 3 passing (420ms)