Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/clstokes/pulumi-aws-ts-ruby-on-rails-unit-testing

An example Pulumi application to run unit tests against a Ruby on Rails application.
https://github.com/clstokes/pulumi-aws-ts-ruby-on-rails-unit-testing

pulumi pulumi-aws

Last synced: 17 days ago
JSON representation

An example Pulumi application to run unit tests against a Ruby on Rails application.

Awesome Lists containing this project

README

        

> :information_source: Based on https://www.pulumi.com/blog/unit-testing-infrastructure-in-nodejs-and-mocha/.

# TypeScript Unit Testing with Pulumi

## To Run Tests

```
$ pulumi preview
```

### Example Output

```
$ pulumi preview
Previewing update (dev):

Type Name Plan Info
+ pulumi:pulumi:Stack pulumi-aws-ts-ruby-on-rails-unit-testing-dev create 1 error; 22 messages
+ ├─ aws:ec2:SecurityGroup webServerSecurityGroup create
+ └─ aws:ec2:Instance webServer create

Diagnostics:
pulumi:pulumi:Stack (pulumi-aws-ts-ruby-on-rails-unit-testing-dev):
Running Mocha Tests: /Users/clstokes/cc/clstokes/pulumi-aws-ts-ruby-on-rails-unit-testing/tests/tests.spec.ts
Infrastructure
#server
1) must have a name tag
#group
2) must not have public internet access
0 passing (2s)
2 failing
1) Infrastructure
#server
must have a name tag:
AssertionError: expected undefined not to be undefined
at Object. (tests/tests.spec.ts:20:55)
at Generator.next ()
at fulfilled (tests/tests.spec.ts:4:58)
2) Infrastructure
#group
must not have public internet access:
AssertionError: expected { Object (protocol, fromPort, ...) } to be undefined
at Suite. (tests/tests.spec.ts:29:45)
at Generator.next ()
at fulfilled (tests/tests.spec.ts:4:58)

error: an unhandled error occurred: Program exited with non-zero exit code: 1

```