<commit_before>module.exports = function (Mocha) {

    var Suite = Mocha.Suite;
    var Test = Mocha.Test;

    return function BochaUI(rootSuite) {
        var suites = [rootSuite];

        rootSuite.on('require', function (obj, file, mocha) {
            visit(obj, file, mocha);
            var testsToFocus = getTestsToFocusForSuite(rootSuite);
            if (testsToFocus.length > 0) {
                var testsRegexParts = [];
                testsToFocus.forEach(function (test) {
                    test.isFocused = true;
                    testsRegexParts.push('^' + test.fullTitle() + '$');
                });<commit_msg>Fix: Escape regex string of focused test titles<commit_after>var escapeRegex = require('escape-string-regexp');

module.exports = function (Mocha) {

    var Suite = Mocha.Suite;
    var Test = Mocha.Test;

    return function BochaUI(rootSuite) {
        var suites = [rootSuite];

        rootSuite.on('require', function (obj, file, mocha) {
            visit(obj, file, mocha);
            var testsToFocus = getTestsToFocusForSuite(rootSuite);
            if (testsToFocus.length > 0) {
                var testsRegexParts = [];
                testsToFocus.forEach(function (test) {
                    test.isFocused = true;
                    testsRegexParts.push('^' + escapeRegex(test.fullTitle()) + '$');
                });
{'fraction_non_alphanumeric': 0.11726147123088128, 'fraction_numerical': 0.0014566642388929353, 'mean_word_length': 2.046563192904656, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5792493', 'n_tokens_mistral': 398, 'n_tokens_neox': 371, 'n_words': 84}