@@ -23,41 +23,43 @@ export = {
23
23
24
24
'outputs cannot be referenced' ( test : Test ) {
25
25
const stack = new Stack ( ) ;
26
- const output = new CfnOutput ( stack , 'MyOutput' , { description : 'My CfnOutput' } ) ;
26
+ const output = new CfnOutput ( stack , 'MyOutput' , { description : 'My CfnOutput' , value : 'boom' } ) ;
27
27
test . throws ( ( ) => output . ref ) ;
28
28
test . done ( ) ;
29
29
} ,
30
30
31
31
'disableExport can be used to disable the auto-export behavior' ( test : Test ) {
32
32
const stack = new Stack ( ) ;
33
- const output = new CfnOutput ( stack , 'MyOutput' , { disableExport : true } ) ;
33
+ const output = new CfnOutput ( stack , 'MyOutput' , { disableExport : true , value : 'boom' } ) ;
34
34
35
35
test . equal ( output . export , null ) ;
36
36
37
37
// cannot specify `export` and `disableExport` at the same time.
38
38
test . throws ( ( ) => new CfnOutput ( stack , 'YourOutput' , {
39
39
disableExport : true ,
40
- export : 'bla'
40
+ export : 'bla' ,
41
+ value : 'boom'
41
42
} ) , / C a n n o t s e t ` d i s a b l e E x p o r t ` a n d s p e c i f y a n e x p o r t n a m e / ) ;
42
43
43
44
test . done ( ) ;
44
45
} ,
45
46
46
47
'if stack name is undefined, we will only use the logical ID for the export name' ( test : Test ) {
47
48
const stack = new Stack ( ) ;
48
- const output = new CfnOutput ( stack , 'MyOutput' ) ;
49
+ const output = new CfnOutput ( stack , 'MyOutput' , { value : 'boom' } ) ;
49
50
test . deepEqual ( stack . node . resolve ( output . makeImportValue ( ) ) , { 'Fn::ImportValue' : 'Stack:MyOutput' } ) ;
50
51
test . done ( ) ;
51
52
} ,
52
53
53
54
'makeImportValue can be used to create an Fn::ImportValue from an output' ( test : Test ) {
54
55
const stack = new Stack ( undefined , 'MyStack' ) ;
55
- const output = new CfnOutput ( stack , 'MyOutput' ) ;
56
+ const output = new CfnOutput ( stack , 'MyOutput' , { value : 'boom' } ) ;
56
57
test . deepEqual ( stack . node . resolve ( output . makeImportValue ( ) ) , { 'Fn::ImportValue' : 'MyStack:MyOutput' } ) ;
57
58
58
59
test . deepEqual ( stack . _toCloudFormation ( ) , {
59
60
Outputs : {
60
61
MyOutput : {
62
+ Value : 'boom' ,
61
63
Export : { Name : 'MyStack:MyOutput' }
62
64
}
63
65
}
0 commit comments