function runTest(dirName, transformName, options, testFilePrefix, testOptions = {}) {
  if (!testFilePrefix) {
    testFilePrefix = transformName;
  }

  // Assumes transform is one level up from __tests__ directory
  const module = require(path.join(dirName, '..', transformName));
  const extension = extensionForParser(testOptions.parser || module.parser)
  const fixtureDir = path.join(dirName, '..', '__testfixtures__');
  const inputPath = path.join(fixtureDir, testFilePrefix + `.input.${extension}`);
  const source = fs.readFileSync(inputPath, 'utf8');
  const expectedOutput = fs.readFileSync(
    path.join(fixtureDir, testFilePrefix + `.output.${extension}`),
    'utf8'
  );
  const testResult = runInlineTest(module, options, {
    path: inputPath,
    source
  }, expectedOutput, testOptions);

  return testResult instanceof Promise ? testResult : undefined;
}
Utility function to run a jscodeshift script within a unit test. This makes
several assumptions about the environment:

- `dirName` contains the name of the directory the test is located in. This
  should normally be passed via __dirname.
- The test should be located in a subdirectory next to the transform itself.
  Commonly tests are located in a directory called __tests__.
- `transformName` contains the filename of the transform being tested,
  excluding the .js extension.
- `testFilePrefix` optionally contains the name of the file with the test
  data. If not specified, it defaults to the same value as `transformName`.
  This will be suffixed with ".input.js" for the input file and ".output.js"
  for the expected output. For example, if set to "foo", we will read the
  "foo.input.js" file, pass this to the transform, and expect its output to
  be equal to the contents of "foo.output.js".
- Test data should be located in a directory called __testfixtures__
  alongside the transform and __tests__ directory.