Skip to content

Commit

Permalink
add boolean case
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Sep 22, 2023
1 parent 7352c27 commit d501cba
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/component/myutils_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,26 @@ describe('Myutils', function() {
newStr.should.be.equal(23);
});
});
describe('When there is a variable which is a boolean', function() {
it('should return the boolean', function() {
var str = '${a}',
map = { a: true },
newStr;
newStr = myutils.expandVar(str, map, true);
should.exist(newStr);
newStr.should.be.equal(true);
});
});
describe('When there is a variable which is a string boolean', function() {
it('should return the boolean', function() {
var str = '${a}',
map = { a: 'true' },
newStr;
newStr = myutils.expandVar(str, map, true);
should.exist(newStr);
newStr.should.be.equal(true);
});
});
describe('When there is a variable which is a null', function() {
it('should return the null', function() {
var str = '${a}',
Expand Down

0 comments on commit d501cba

Please sign in to comment.