Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/clstokes/pulumi-aws-ts-ruby-on-rails-unit-testing
- Owner: clstokes
- Created: 2019-06-14T00:55:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-16T04:28:52.000Z (over 5 years ago)
- Last Synced: 2024-11-08T13:55:35.564Z (2 months ago)
- Topics: pulumi, pulumi-aws
- Language: TypeScript
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 createDiagnostics:
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
```