diff --git a/test/common/util.js b/test/common/util.js index 476eec84..8c774281 100644 --- a/test/common/util.js +++ b/test/common/util.js @@ -8,6 +8,7 @@ const { kebabToCamelCase, findObjByNameInArr, getRegExp, + escapeRegExp, } = Util; test('getExt: no extension', (t) => { @@ -102,3 +103,13 @@ test('util: getRegExp', (t) => { t.end(); }); +test('util: escapeRegExp: no str', (t) => { + t.equal(escapeRegExp(1), 1, 'should equal'); + t.end(); +}); + +test('util: escapeRegExp', (t) => { + t.equal(escapeRegExp('#hello'), '\\#hello', 'should equal'); + t.end(); +}); +