createErrorForNumericPositionalArg = (
  numericArg,
  allArgs,
  parsedResult
) => {
  // A flag for `numericArg` exists if:
  // 1. A mocha flag immediately preceeded the numericArg in `allArgs` array and
  // 2. `numericArg` value could not be assigned to this flag by `yargs-parser` because of incompatible datatype.
  const flag = allArgs.find((arg, index) => {
    const normalizedArg = arg.replace(/^--?/, '');
    return (
      isMochaFlag(arg) &&
      allArgs[index + 1] === String(numericArg) &&
      parsedResult[normalizedArg] !== String(numericArg)
    );
  });

  if (flag) {
    throw createInvalidArgumentTypeError(
      `Mocha flag '${flag}' given invalid option: '${numericArg}'`,
      numericArg,
      expectedTypeForFlag(flag)
    );
  } else {
    throw createUnsupportedError(
      `Option ${numericArg} is unsupported by the mocha cli`
    );
  }
}
Throws either "UNSUPPORTED" error or "INVALID_ARG_TYPE" error for numeric positional arguments.
@param {string[]} allArgs - Stringified args passed to mocha cli
@param {number} numericArg - Numeric positional arg for which error must be thrown
@param {Object} parsedResult - Result from `yargs-parser`
@private
@ignore