1.0.0-beta.6 • Published 17 days ago

eslint-plugin-jest-mock-config v1.0.0-beta.6

Weekly downloads
-
License
MIT
Repository
github
Last release
17 days ago

eslint-plugin-jest-mock-config

NPM Version Package License GitHub Actions Workflow Status

ESLint rules for mocking in jest using jest.mock(...).

Rules

This Plugin currently contains the following ESLint rules:

NameDescriptionDocumentation
jest-mock-without-importReports jest.mock(<path>), when no import of <path> exitstsLink
jest-mocked-without-mockReports jest.mocked(<function>), when the import of <function> is not mocked via jest.mockLink
jest-mock-multiple-with-same-pathReports, if jest.mock(<path>) is used multiple times with the same path in one fileLink

Installation

# npm
npm install --safe-dev eslint-plugin-jest-mock-config

#yarn
yarn add --dev eslint-plugin-jest-mock-config

Development

Tests

npm test

Usage

When to use the plugin

If you are using jest with JavaScript or TypeScipt for your tests and want to detect wrong configurations of your jest mocks.

When to not use the plugin

If you are not using jest in your project

ESLint7 / 8 / 9 compatibility

Rules included in this ESLint plugin are tested with Version 7 / 8 and 9 of ESLint. See the github actions testing all rules for eslint7, 8 and 9 and the related (stub-) projects localed in examples.

Please report bugs here, if you still encounter some!

1.0.0-beta.6

17 days ago

1.0.0-beta.5

21 days ago

1.0.0-beta.3

25 days ago

1.0.0-beta.4

24 days ago

1.0.0-beta.2

1 month ago

1.0.0-beta.1

1 month ago

1.0.0-beta.0

2 months ago