Given a file that is already importing jest globals, the current logic will actually remove the import, resulting in a ReferenceError when tests are run with the modified files.
I would expect any globals that have a corresponding ImportSpecifier would be left untouched.
Given a file that is already importing jest globals, the current logic will actually remove the import, resulting in a
ReferenceError
when tests are run with the modified files.I would expect any globals that have a corresponding
ImportSpecifier
would be left untouched.Example input:
Actual output:
Expected output:
I have a fix for this queued up if you agree with my interpretation of the intended behavior.