jest-codemods icon indicating copy to clipboard operation
jest-codemods copied to clipboard

Feature Suggestion: Migration from outdated versions of Jest

Open GeorgeWL opened this issue 3 years ago • 4 comments

I was hoping the codemod could handle some of the dirty work for me, but sadly not, but I've currently got a project where as part of trying to remove tech debt, we're upgrading outdated and insecure modules, and upgrading to latest jest automagically using this tool would've been nice

I have a feeling it probably would be quite difficult to implement though, so can totally understand if y'all feel it is out of spec for this codemod

GeorgeWL avatar Feb 18 '22 10:02 GeorgeWL

We originally planned to write codemods for Jest to handle API renames, but nobody had the energy to make it happen, so we never did 😀

The ESLint plugin can do some things, but it's not super extensive.

SimenB avatar Feb 18 '22 11:02 SimenB

would help if @jest-community had official upgrade guides to be honest, then it would be easier to do 💯

GeorgeWL avatar Feb 18 '22 11:02 GeorgeWL

Yep, but that requires time and effort to write, of which volunteers often have little 🙂

SimenB avatar Feb 18 '22 11:02 SimenB

Doing migration from outdated version as part of jest-codemods seems a bit out of scope, which is:

"simplify migrating JavaScript and TypeScript test files from AVA, Chai, Expect.js (by Automattic), [email protected] (by mjackson), Jasmine, Mocha, proxyquire, Should.js, Tape and Node-Tap to Jest"

But that being said I'm not opposed to the idea if someone has time for adding this. The infrastructure and required setup is already in place.

skovhus avatar Mar 02 '22 11:03 skovhus