jscodeshift
jscodeshift copied to clipboard
ApplyTransform test util requires `input` to be manually wrapped in a file object
The docs currently say that applyTransform
should be used like this:
const applyTransform = require('jscodeshift/dist/testUtils').applyTransform;
const transform = require('../myTransform');
const transformOptions = {};
const output = applyTransform(transform, transformOptions, 'input');
But the 'input' argument should really be an object in the shape:
applyTransform(transform, transformOptions, { source: 'input' });
for it to be compatible at runtime.