sindresorhus/eslint-plugin-unicorn

consistent-function-scoping should ignore jest mocks

Open

#805 创建于 2020年8月4日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)JavaScript (5,022 star) (468 fork)user submission
enhancementhelp wanted

描述

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");

贡献者指南