/**
 * Run mocha tests.
 * @function ci.worker.runMocha
 * @param {object} config - Work configuration.
 * @param {string[]} config.files - mocha test files.
 * @param {number} config.timeout - Timeout duration.
 * @param {function} callback - Callback when done.
 * @author Taka Okunishi
 *
 */

var _runTest = require('./_run_test');

exports = module.exports = function (config, callback) {
    var timeout = config.timeout || 4000;
    _runTest({
        files: config.files,
        runnerFile: require.resolve('./.private/_mocha_runner'),
        runArgs: [timeout]
    }, callback);
};