<commit_before>'use strict';

var grunt = require('grunt');

var BOOL_OPTIONS = [
    'invert',
    'colors',
    'no-colors',
    'growl',
    'debug',
    'bail',
    'recursive',
    'debug-brk',
    'ignore-leaks'
];
var STRING_OPTIONS = [
    'reporter',
    'ui',
    'grep',
    'timeout',
    'slow'
];
var ARRAY_OPTIONS = [
    'globals',
    'compilers'
];


module.exports = function (options, callback) {
    var args = [];
    var spawnOptions = {
        cmd: __dirname + '/../node_modules/.bin/mocha'
    };

    if (process.platform === 'win32') {
        spawnOptions.cmd += '.cmd';
    }

    if (!options.quiet) {
        // Redirect the Mocha output directly to the terminal to maintain colors
        spawnOptions.opts = {stdio: 'inherit'};
    }<commit_msg>Improve the Mocha binary path resolution<commit_after>'use strict';

var grunt = require('grunt');
var path = require('path');

var BOOL_OPTIONS = [
    'invert',
    'colors',
    'no-colors',
    'growl',
    'debug',
    'bail',
    'recursive',
    'debug-brk',
    'ignore-leaks'
];
var STRING_OPTIONS = [
    'reporter',
    'ui',
    'grep',
    'timeout',
    'slow'
];
var ARRAY_OPTIONS = [
    'globals',
    'compilers'
];


module.exports = function (options, callback) {
    var args = [];
    var spawnOptions = {};

    spawnOptions.cmd = require.resolve('mocha');
    spawnOptions.cmd = path.dirname(spawnOptions.cmd);
    spawnOptions.cmd += '/bin/mocha';

    if (process.platform === 'win32') {
        spawnOptions.cmd += '.cmd';
    }

    if (!options.quiet) {
        // Redirect the Mocha output directly to the terminal to maintain colors
        spawnOptions.opts = {stdio: 'inherit'};
    }
{'fraction_non_alphanumeric': 0.16391509433962265, 'fraction_numerical': 0.0023584905660377358, 'mean_word_length': 2.535416666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6383046', 'n_tokens_mistral': 597, 'n_tokens_neox': 580, 'n_words': 129}