/**
 * Run nodeunit tests.
 * @function ci.worker.runNodeunit
 * @param {object} config - Work configuration.
 * @param {string} config.reporter - nodeunit reporter.
 * @param {string[]} config.files - nodeunit test files.
 * @param {function} callback - Callback when done.
 * @author Taka Okunishi
 *
 */

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

exports = module.exports = function (config, callback) {
    var reporter = config.reporter || 'default';

    _runTest({
        files: config.files,
        runnerFile: require.resolve('./.private/_nodeunit_runner'),
        runArgs: [reporter]
    }, callback);
};

