Skip to content

Commit 3b5b597

Browse files
committed
test(escapeRegExp): Test for regExp utility function added to check that it returns a valid regex pa
1 parent 039b3bf commit 3b5b597

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/modules/utils.test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,15 @@ describe('deepExtend() method',function(){
7676
it('should return an object', function(){
7777
expect(utils.deepExtend(opts, defaults)).to.be.a('object');
7878
});
79+
80+
});
81+
82+
83+
describe('escapeRegExp() method', function(){
84+
"use strict";
85+
var x = ':):/';
86+
it('should return a valid regex pattern', function(){
87+
var reg = new RegExp(utils.escapeRegExp(x),'g');
88+
expect(x).to.match(reg);
89+
});
7990
});

0 commit comments

Comments
 (0)