function replaceInputFS(test, {jscodeshift: j}, {verbose}) {
  let shouldReplace = false;
  test.find(j.CallExpression).forEach(node => {
    let {loc, arguments: args, callee} = node.value;
    let name = callee?.name;
    switch (name) {
      case 'bundle':
      case 'bundler': {
        let options = args[1];
        if (options) {
          if (options.type === 'Identifier') {
            args[1] = j.objectExpression([
              j.property(
                'init',
                j.identifier('inputFS'),
                j.identifier('overlayFS'),
              ),
              j.spreadElement(options),
            ]);
            if (verbose) {
              console.log(
                chalk.dim(
                  `Adding ${chalk.yellow(
                    'inputFS: overlayFS',
                  )} option arg to ${chalk.yellow(name)} call at ${printLoc(
                    loc,
                  )}`,
                ),
              );
            }
          } else {
            if (options.type !== 'ObjectExpression') {
              throw new Error(
                `Expected options to be an object, but saw ${options.type}`,
              );
            }
            let inputFS = options.properties.find(
              prop => prop.key.name === 'inputFS',
            );
            if (!inputFS) {
              shouldReplace = true;
              options.properties.push(
                j.property(
                  'init',
                  j.identifier('inputFS'),
                  j.identifier('overlayFS'),
                ),
              );
              if (verbose) {
                console.log(
                  chalk.dim(
                    `Adding ${chalk.yellow(
                      'inputFS: overlayFS',
                    )} option to ${chalk.yellow(name)} call at ${printLoc(
                      loc,
                    )}`,
                  ),
                );
              }
            } else if (verbose) {
              console.log(
                chalk.yellow(
                  `Skipping ${name} call at ${printLoc(
                    loc,
                  )} because it already had an inputFS option.`,
                ),
              );
            }
          }
        } else {
          shouldReplace = true;
          args[1] = j.objectExpression([
            j.property(
              'init',
              j.identifier('inputFS'),
              j.identifier('overlayFS'),
            ),
          ]);
          if (verbose) {
            console.log(
              chalk.dim(
                `Adding ${chalk.yellow(
                  'inputFS: overlayFS',
                )} option arg to ${chalk.yellow(name)} call at ${printLoc(
                  loc,
                )}`,
              ),
            );
          }
        }
        break;
      }
      case 'assertESMExports':
      case 'ncp': {
        let arity = nullthrows(TEST_UTIL_ARITY[name]);
        if (arity != null && args.length < arity) {
          while (args.length < arity - 1) {
            args.push(j.literal(null));
          }
          args.push(j.identifier('overlayFS'));
          if (verbose) {
            console.log(
              chalk.dim(
                `Adding ${chalk.yellow('overlayFS')} argument to ${chalk.yellow(
                  name,
                )} call at ${printLoc(loc)}`,
              ),
            );
          }
        } else if (verbose) {
          console.log(
            chalk.yellow(
              `Skipping ${name} call at ${printLoc(
                loc,
              )} because it already has an fs argument.`,
            ),
          );
        }
        break;
      }
    }
  });

  if (shouldReplace) {
    test.find(j.Identifier, {name: 'inputFS'}).forEach(path => {
      if (path.parentPath.value.type === 'Property') return;
      if (verbose) {
        console.log(
          chalk.dim(
            `Replacing ${chalk.yellow('inputFS')} with ${chalk.yellow(
              'overlayFS',
            )} at ${printLoc(path.value.loc)}`,
          ),
        );
      }
      path.value.name = 'overlayFS';
    });
  }
}
Where possible, specifies `overlayFS` as the input fs for the test.

For example, in a test that uses the `bundle` test util, the options
to the `bundle` call will be updated to use `overlayFS` as the input fs,
unless already specified.