trivikr / vitest-codemod

Codemod scripts to migrate your JavaScript unit tests to vitest
MIT License
23 stars 2 forks source link

[Feature]: Comment out disableAutomock with explanation as vitest does not mock by default #111

Closed trivikr closed 1 year ago

trivikr commented 1 year ago

Self-service

Template name

jest

Input code

jest.disableAutomock();

Expected Output

This currently throws an error:

Error: The automocking API "disableAutomock" is not supported in vitest.
Please switch to explicit mocking in Jest before running transformation, or skip transformation on the files which uses this API.

It can instead put a comment in code to comment out disableAutomock with explanation in code

// Vitest does not automock by default https://vitest.dev/guide/migration.html
// Explicit call to disable automock can be deleted.
// jest.disableAutomock();

Additional context

No response

github-actions[bot] commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.