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
It would be really useful to have a lint rule that tells you when the path supplied to jest.mock does not exist. I would envision the rule working like this:
Disallow mocking of module paths that do not exist
When using jest.mock and jest.doMock, the path supplied must be an module or local file that exists.
Rule details
This rule triggers an error if the path supplied to jest.mock or jest.doMock does not exist.
The following patterns are considered errors:
// Module that cannot be foundjest.mock('some-module-not-in-package-json');// Local file that cannot be foundjest.mock('../../this/path/does/not/exist');
The following patterns not considered errors:
// Module that can be foundjest.mock('some-module-in-package-json');// Local file that can be foundjest.mock('../../this/path/really/does/exist');
The text was updated successfully, but these errors were encountered:
It would be really useful to have a lint rule that tells you when the path supplied to
jest.mock
does not exist. I would envision the rule working like this:Disallow mocking of module paths that do not exist
When using
jest.mock
andjest.doMock
, the path supplied must be an module or local file that exists.Rule details
This rule triggers an error if the path supplied to
jest.mock
orjest.doMock
does not exist.The following patterns are considered errors:
The following patterns not considered errors:
The text was updated successfully, but these errors were encountered: