sindresorhus/eslint-plugin-unicorn
consistent-function-scoping should ignore jest mocks
Closed
#805 opened on Aug 4, 2020
enhancementhelp wanted
Repository metrics
- Stars
- (5,022 stars)
- PR merge metrics
- (Avg merge 1d 16h) (399 merged PRs in 30d)
Description
Using jest.mock() does not work properly with consistent-function-scoping as it's not allowed to reference any out of scope variables as mocked function.
ReferenceError: /__tests__/search.spec.tsx: The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables.
jest.mock("next/dynamic", () => () => "dynamic-drawer");