@@ -86,6 +86,18 @@ describe('variables - module', () => {
86
86
description : 'A bool with a default value' ,
87
87
default : false ,
88
88
} ,
89
+ {
90
+ name : 'testLevelTwoNesting' ,
91
+ type : 'string' ,
92
+ description : 'A variable with a variable reference' ,
93
+ default : 'I am unable to hold another level of reference ${{ testWithDefault }}' ,
94
+ } ,
95
+ {
96
+ name : 'testVariableReference' ,
97
+ type : 'string' ,
98
+ description : 'A variable with a variable reference' ,
99
+ default : 'I reference the value of ${{ testNumber }} and ${{ testLevelTwoNesting }}' ,
100
+ } ,
89
101
] ,
90
102
} ;
91
103
pkg2Comp1Manifest = {
@@ -241,6 +253,12 @@ describe('variables - module', () => {
241
253
expect ( envVars [ 'builtin_package_github_ref' ] ) . to . equal ( 'v1.1.1' ) ;
242
254
expect ( envVars [ 'builtin_component_id' ] ) . to . equal ( 'test-component' ) ;
243
255
} ) ;
256
+ it ( 'should allow one level of variable references' , ( ) => {
257
+ const vars = VariableCollection . build ( [ componentContext ] , variablesMapProjCfg , componentContext ) ;
258
+ expect ( vars . substitute ( '${{ testVariableReference }}' ) ) . to . equal (
259
+ 'I reference the value of 1 and I am unable to hold another level of reference ${{ testWithDefault }}' ,
260
+ ) ;
261
+ } ) ;
244
262
it ( 'should not throw an error when trying to build VariableCollection with identical VariableDefinition names' , ( ) => {
245
263
const buildVariableCollection = ( ) => {
246
264
const alreadyExistingVariableDefName = {
0 commit comments