diff options
Diffstat (limited to 'spec/frontend/lib/utils/text_utility_spec.js')
-rw-r--r-- | spec/frontend/lib/utils/text_utility_spec.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/frontend/lib/utils/text_utility_spec.js b/spec/frontend/lib/utils/text_utility_spec.js index 0878c1de095..e31cbbaf99e 100644 --- a/spec/frontend/lib/utils/text_utility_spec.js +++ b/spec/frontend/lib/utils/text_utility_spec.js @@ -176,4 +176,11 @@ describe('text_utility', () => { }); }); }); + + describe('escapeRegExp', () => { + it('escapes regexp special characters', () => { + const str = '[\\^$.*+?()[]{}|]'; + expect(textUtils.escapeRegExp(str)).toBe('\\[\\\\\\^\\$\\.\\*\\+\\?\\(\\)\\[\\]\\{\\}\\|\\]'); + }); + }); }); |