From 05b141ce681c3cdfd9996ca1e27fbcf91741e223 Mon Sep 17 00:00:00 2001 From: horike37 Date: Mon, 24 Oct 2016 22:32:48 +0900 Subject: [PATCH] Restore the test --- lib/classes/Variables.test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 = {};