Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/lib/utils/text_utility_spec.js')
-rw-r--r--spec/frontend/lib/utils/text_utility_spec.js7
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('\\[\\\\\\^\\$\\.\\*\\+\\?\\(\\)\\[\\]\\{\\}\\|\\]');
+ });
+ });
});