@@ -5,7 +5,7 @@ import "mocha";
55import * as assert from 'assert' ;
66
77pulumi . runtime . setMocks ( {
8- newResource : function ( args : pulumi . runtime . MockResourceArgs ) : { id : string , state : any } {
8+ newResource : function ( args : pulumi . runtime . MockResourceArgs ) : { id : string , state : any } {
99 switch ( args . type ) {
1010 default :
1111 return {
@@ -16,40 +16,41 @@ pulumi.runtime.setMocks({
1616 } ;
1717 }
1818 } ,
19- call : function ( args : pulumi . runtime . MockCallArgs ) {
19+ call : function ( args : pulumi . runtime . MockCallArgs ) {
2020 switch ( args . token ) {
2121 default :
2222 return args ;
2323 }
2424 } ,
2525} ) ;
2626
27- describe ( "BucketPair" , function ( ) {
27+ describe ( "BucketPair" , function ( ) {
28+ this . timeout ( 10000 ) ; // Extend the timeout for this suite
29+
2830 let module : typeof import ( "./bucket_pair" ) ;
2931
30- before ( async function ( ) {
32+ before ( async function ( ) {
33+ this . timeout ( 10000 ) ; // Extend timeout for the import
3134 // It's important to import the program _after_ the mocks are defined.
3235 module = await import ( "./bucket_pair" ) ;
3336 } ) ;
3437
35- describe ( "constructor" , function ( ) {
36- it ( "must pass bucket names" , function ( done ) {
38+ describe ( "constructor" , function ( ) {
39+ it ( "must pass bucket names" , function ( done ) {
3740 const bucketPair = new module . BucketPair ( 'my_content_bucket' , 'my_logs_bucket' , { } ) ;
3841 const outputs = [ bucketPair . contentBucket . bucket , bucketPair . logsBucket . bucket ] ;
42+
3943 pulumi . all ( outputs ) . apply ( ( [ contentBucketName , logsBucketName ] ) => {
40- try
41- {
42- /*
43- * If you don't have the try/catch in here, if the assert fails it'll just timeout
44- * If you have the try/catch, the "done()" in the catch block will get hit and it won't time out (async fun)
45- */
44+ try {
45+ console . log ( "Testing outputs:" , { contentBucketName, logsBucketName } ) ;
4646 assert . strictEqual ( contentBucketName , 'my_content_bucket' ) ;
4747 assert . strictEqual ( logsBucketName , 'my_logs_bucket' ) ;
4848 done ( ) ;
49- } catch ( e ) {
49+ } catch ( e ) {
5050 done ( e ) ;
5151 }
5252 } ) ;
5353 } ) ;
5454 } ) ;
5555} ) ;
56+
0 commit comments