diff --git a/lib/classes/Variables.test.js b/lib/classes/Variables.test.js index b60c9c59e..2d3e5572b 100644 --- a/lib/classes/Variables.test.js +++ b/lib/classes/Variables.test.js @@ -165,6 +165,17 @@ describe('Variables', () => { expect(newProperty).to.equal('your account number is 5'); }); + it('should populate non string variables', () => { + const serverless = new Serverless(); + const valueToPopulate = 5; + const matchedString = '${opt:number}'; + const property = '${opt:number}'; + + const newProperty = serverless.variables + .populateVariable(property, matchedString, valueToPopulate); + expect(newProperty).to.equal('5'); + }); + it('should throw error if populating non string or non number variable as sub string', () => { const serverless = new Serverless(); const valueToPopulate = {};