function runMochaJSON(fixturePath, args, done, opts) {
  if (typeof args === 'function') {
    opts = done;
    done = args;
    args = [];
  }

  return invokeMocha(
    [...args, '--reporter', 'json', resolveFixturePath(fixturePath)],
    (err, res) => {
      if (err) {
        return done(err);
      }

      let result;
      try {
        result = toJSONResult(res);
      } catch (err) {
        return done(
          new Error(
            format(
              'Failed to parse JSON reporter output. Error:\n%O\nResult:\n%O',
              err,
              res
            )
          )
        );
      }
      done(null, result);
    },
    opts
  );
}
Invokes the mocha executable for the given fixture using the `json` reporter,
calling callback `done` with parsed output.

Use when you expect `mocha` _not_ to fail (test failures OK); the output from
the `json` reporter--and thus the entire subprocess--must be valid JSON!

By default, `STDERR` is ignored. Pass `{stdio: 'pipe'}` as `opts` if you
want it.
@param {string} fixturePath - Path from `__dirname__`
@param {string[]|JSONResultCallback} args - Args to `mocha` or callback
@param {JSONResultCallback|Object} done - Callback or options
@param {Object} [opts] - Opts for `spawn()`
@returns {ChildProcess} Subprocess instance