async function runMochaWatchJSONAsync(args, opts, change) {
  const res = await runMochaWatchAsync(
    [...args, '--reporter', 'json'],
    opts,
    change
  );
  return (
    res.output
      // eslint-disable-next-line no-control-regex
      .replace(/\u001b\[\?25./g, '')
      .split('\u001b[2K')
      .filter(x => x)
      .map(x => JSON.parse(x))
  );
}
Runs the mocha executable in watch mode calls `change` and returns the
JSON result.

The function starts mocha with the given arguments and `--watch` and
waits until the first test run has completed. Then it calls `change`
and waits until the second test run has been completed. Mocha is
killed and the result is returned.

On Windows, this will call `child_process.fork()` instead of `spawn()`.

**Exit code will always be 0**
@param {string[]} args - Array of argument strings
@param {object|string} opts - If a `string`, then `cwd`, otherwise options for `child_process`
@param {Function} change - A potentially `Promise`-returning callback to execute which will change a watched file
@returns {Promise<JSONResult>}