src/adapter.js
function (clientArguments) {
  var grepRegex = /^--grep=(.*)$/;

  if (Object.prototype.toString.call(clientArguments) === '[object Array]') {
    var indexOfGrep = indexOf(clientArguments, '--grep');

    if (indexOfGrep !== -1) {
      return clientArguments[indexOfGrep + 1]
    }

    return map(filter(clientArguments, function (arg) {
      return grepRegex.test(arg)
    }), function (arg) {
      return arg.replace(grepRegex, '$1')
    })[0] || ''
  } else if (typeof clientArguments === 'string') {
    var match = /--grep=([^=]+)/.exec(clientArguments);

    return match ? match[1] : ''
  }
}
function (clientArguments) {
  var grepRegex = /^--grep=(.*)$/;

  if (Object.prototype.toString.call(clientArguments) === '[object Array]') {
    var indexOfGrep = indexOf(clientArguments, '--grep');

    if (indexOfGrep !== -1) {
      return clientArguments[indexOfGrep + 1]
    }

    return map(filter(clientArguments, function (arg) {
      return grepRegex.test(arg)
    }), function (arg) {
      return arg.replace(grepRegex, '$1')
    })[0] || ''
  } else if (typeof clientArguments === 'string') {
    var match = /--grep=([^=]+)/.exec(clientArguments);

    return match ? match[1] : ''
  }
}
function ( clientArguments ) { var grepRegex = / ^--grep=(.*)$ / ; if ( Object . prototype . toString . call ( clientArguments ) === '[object Array]' ) { var indexOfGrep = indexOf ( clientArguments , '--grep' ) ; if ( indexOfGrep !== - 1 ) { return clientArguments [ indexOfGrep + 1 ] } return map ( filter ( clientArguments , function ( arg ) { return grepRegex . test ( arg ) } ) , function ( arg ) { return arg . replace ( grepRegex , '$1' ) } ) [ 0 ] || '' } else if ( typeof clientArguments === 'string' ) { var match = / --grep=([^=]+) / . exec ( clientArguments ) ; return match ? match [ 1 ] : '' } }
Extract grep option from karma config
@param {[Array|string]} clientArguments The karma client arguments
@return {string} The value of grep option by default empty string
Extract grep option from karma config