sindresorhus/eslint-plugin-unicorn
consistent-function-scoping should ignore jest mocks
クローズ
#805 opened on 2020/08/04
enhancementhelp wanted
Repository metrics
- Stars
- (5,022 個のスター)
- PR merge metrics
- (平均マージ 4h 30m) (30d で 26 merged PRs)
説明
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");