1.0.0-beta.9 • Published 9 months ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months 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

| Rules showing errors | jest-mock-without-import | Reports jest.mock(<path>), when no import of <path> exists | Link | jest-mocked-without-mock | Reports jest.mocked(<function>), when the import of <function> is not mocked via jest.mock | Link | jest-mock-multiple-with-same-path | Reports, if jest.mock(<path>) is used multiple times with the same path in one file | Link | Layouting rules | jest-mock-directly-above-jest-mocked | Reports, if a jest.mock() call and its corresponding jest.mocked call don't come directly after each other. Conflicts with jest-mock-grouped and jest-mocked-grouped | Link | jest-mock-grouped | Reports, if not all jest.mock() calls come directly after each other. Conflicts with jest-mock-directly-above-jest-mocked | Link | jest-mocked-grouped | Reports, if not all jest.mocked() calls come directly after each other. Conflicts with jest-mock-directly-above-jest-mocked | Link

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.9

9 months ago

1.0.0-beta.8

12 months ago

1.0.0-beta.7

12 months ago

1.0.0-beta.6

1 year ago

1.0.0-beta.5

1 year ago

1.0.0-beta.3

1 year ago

1.0.0-beta.4

1 year ago

1.0.0-beta.2

1 year ago

1.0.0-beta.1

1 year ago

1.0.0-beta.0

1 year ago