ITADN

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

#111Closedtrivikr 创建于 2023-02-13
enhancement
T
trivikrcommented
### Self-service - [ ] I'd be willing to implement this feature ### Template name jest ### Input code ```js jest.disableAutomock(); ``` ### Expected Output This currently throws an error: ```console 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 ```js // 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_
关闭于 2023-02-14 0 条评论