@@ -4,7 +4,7 @@ import * as pulumi from "@pulumi/pulumi";
44import "mocha" ;
55
66pulumi . runtime . setMocks ( {
7- newResource : function ( args : pulumi . runtime . MockResourceArgs ) : { id : string , state : any } {
7+ newResource : function ( args : pulumi . runtime . MockResourceArgs ) : { id : string , state : any ; } {
88 switch ( args . type ) {
99 case "aws:ec2/securityGroup:SecurityGroup" :
1010 return {
@@ -39,7 +39,7 @@ pulumi.runtime.setMocks({
3939 } ;
4040 }
4141 } ,
42- call : function ( args : pulumi . runtime . MockCallArgs ) {
42+ call : function ( args : pulumi . runtime . MockCallArgs ) {
4343 switch ( args . token ) {
4444 case "aws:ec2/getAmi:getAmi" :
4545 return {
@@ -52,17 +52,17 @@ pulumi.runtime.setMocks({
5252 } ,
5353} ) ;
5454
55- describe ( "Infrastructure" , function ( ) {
56- let infra : typeof import ( "./index" ) ;
55+ describe ( "Infrastructure" , function ( ) {
56+ let infra : typeof import ( "./index.ts " ) ;
5757
58- before ( async function ( ) {
58+ before ( async function ( ) {
5959 // It's important to import the program _after_ the mocks are defined.
60- infra = await import ( "./index" ) ;
60+ infra = await import ( "./index.ts " ) ;
6161 } ) ;
6262
63- describe ( "#server" , function ( ) {
63+ describe ( "#server" , function ( ) {
6464 // check 1: Instances have a Name tag.
65- it ( "must have a name tag" , function ( done ) {
65+ it ( "must have a name tag" , function ( done ) {
6666 pulumi . all ( [ infra . server . urn , infra . server . tags ] ) . apply ( ( [ urn , tags ] ) => {
6767 if ( ! tags || ! tags [ "Name" ] ) {
6868 done ( new Error ( `Missing a name tag on server ${ urn } ` ) ) ;
@@ -73,7 +73,7 @@ describe("Infrastructure", function() {
7373 } ) ;
7474
7575 // check 2: Instances must not use an inline userData script.
76- it ( "must not use userData (use an AMI instead)" , function ( done ) {
76+ it ( "must not use userData (use an AMI instead)" , function ( done ) {
7777 pulumi . all ( [ infra . server . urn , infra . server . userData ] ) . apply ( ( [ urn , userData ] ) => {
7878 if ( userData ) {
7979 done ( new Error ( `Illegal use of userData on server ${ urn } ` ) ) ;
@@ -84,13 +84,13 @@ describe("Infrastructure", function() {
8484 } ) ;
8585 } ) ;
8686
87- describe ( "#group" , function ( ) {
87+ describe ( "#group" , function ( ) {
8888 // check 3: Instances must not have SSH open to the Internet.
89- it ( "must not open port 22 (SSH) to the Internet" , function ( done ) {
90- pulumi . all ( [ infra . group . urn , infra . group . ingress ] ) . apply ( ( [ urn , ingress ] ) => {
89+ it ( "must not open port 22 (SSH) to the Internet" , function ( done ) {
90+ pulumi . all ( [ infra . group . urn , infra . group . ingress ] ) . apply ( ( [ urn , ingress ] ) => {
9191 if ( ingress . find ( rule =>
9292 rule . fromPort === 22 && ( rule . cidrBlocks || [ ] ) . find ( block => block === "0.0.0.0/0" ) ) ) {
93- done ( new Error ( `Illegal SSH port 22 open to the Internet (CIDR 0.0.0.0/0) on group ${ urn } ` ) ) ;
93+ done ( new Error ( `Illegal SSH port 22 open to the Internet (CIDR 0.0.0.0/0) on group ${ urn } ` ) ) ;
9494 } else {
9595 done ( ) ;
9696 }
0 commit comments