You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dealing with large repository often lead to refactoring where we rename, update, delete some path. Most IDE are able to rename, and show where the import are.
But when mocking a local import (https://vitest.dev/api/vi.html#vi-mock) we may have some tests failing, because we changed a filename, and finding where the problem is occurring might be difficult.
A rule where we would ensure that the path mocked exists would be amazing (if feasible)
The text was updated successfully, but these errors were encountered:
how would that rule help you specifically, check if a file exists?
I can see several cases
it would allow us to catch typo, if you misspelled a mock, it would tell you that the mock does not mock anything.
when running the CI, the linter is usually run before the unit tests (at least for us), so it would be before the tests are ran stating: the mock is not valid, you did a change that broke those tests
I don't know exactly how internally it would work (never implemented any eslint before), checking that file exists would be a solution, telling you this does not exist etc.
Description
Dealing with large repository often lead to refactoring where we rename, update, delete some path. Most IDE are able to rename, and show where the import are.
But when mocking a local import (https://vitest.dev/api/vi.html#vi-mock) we may have some tests failing, because we changed a filename, and finding where the problem is occurring might be difficult.
A rule where we would ensure that the path mocked exists would be amazing (if feasible)
The text was updated successfully, but these errors were encountered: