From 42c6c37ed8bc648ceca32edb87dd9acc391de068 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 3 Aug 2017 16:29:24 +0300 Subject: [PATCH] test(util) escapeRegExp --- test/common/util.js | 11 +++++++++++ 1 file changed, 11 insertions(+) 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(); +}); +