async function transform(file, api, options) {
  const j = api.jscodeshift;
  const root = j(file.source);

  // Manage a local copy of options so we can modify it iteratively.
  let opts = {...options, dryRun: options.dryRun ?? options.dry};
  let hasTransformedFixtures = false;

  // Manage a stack of tests so we can interactively transform them,
  // e.g., view the diff, then decide to transform or not.
  let tests = [...findTestsWithFixturePaths(root, api, opts)].reverse();

  let printedDiff = new Set();
  outer: while (tests.length) {
    let [test, fixturePaths] = tests.pop();
    let testName = getTestName(test, api);

    if (!shouldTransformTest(testName, opts.grep)) {
      if (opts.verbose) {
        console.log(
          chalk.yellow(
            `Skipping ${chalk.blue(
              testName,
            )} because it does not match grep patterns.`,
          ),
        );
      }
      continue;
    }

    assertIsAsyncTest(file, test, api);

    if (opts.verbose && (!opts.yes || opts.dryRun) && !printedDiff.has(test)) {
      await printDiff(testName, test.toSource(), api, opts);
    }
    printedDiff.add(test);

    switch (await promptToTransformFixtures(testName, opts)) {
      case true: {
        let fixtures = await generateFsFixtures(fixturePaths, api, opts);
        if (fixtures.size) {
          insertFsFixtures(test, fixtures, api, opts);
          replaceInputFS(test, api, opts);
          replaceFixturePaths(fixturePaths, api, opts);

          hasTransformedFixtures = true;

          // Report converted fixture filePaths for cleanup.
          for (let fixturePath of fixtures.keys()) {
            process.send?.({type: 'fixture', filePath: file.path, fixturePath});
          }

          // Also report the test scope so we know which tests need to be run.
          process.send?.({type: 'test', filePath: file.path, testName});
        }
        break;
      }
      case 'all': {
        opts.yes = true;
        tests.push([test, fixturePaths]);
        break;
      }
      case 'none': {
        break outer;
      }
      case 'view': {
        await printDiff(testName, test.toSource(), api, opts);
        tests.push([test, fixturePaths]);
        break;
      }
    }
  }

  if (hasTransformedFixtures) {
    insertFsFixtureImport(root, api, options);
    // Only return something if we changed something.
    return root.toSource();
  }
}
Finds all tests that use fs fixtures and converts them to use fsFixture.

This is the transform that jscodeshift will run on each file.