Skip to content

Improve compatibility with prop-types in Jest by failing prop-types bug tests instead of ignoring them.

License

Notifications You must be signed in to change notification settings

vicasas/jest-prop-types

Repository files navigation

jest-prop-types

This little library improves support for accessory types in Jest by failing accessory type bug tests instead of ignoring them.

Every time the test runs and every time a faulty accessory is sent to your component, the accessory type validation will detect it and cause the test to fail.

Installation

npm install --save-dev jest-prop-types

Usage

To catch accessory errors and Jest fail the test, you need to add the following to your jest.config.js file.

{
  "setupFiles": [
    "jest-prop-types"
  ]
}

Whit Create React App

Create React App does not allow the use of setupFiles, instead add jest-prop-types to your setupTests.js file.

import 'jest-prop-types'

Contributing

Read the contributing guide to learn about our development process, how to propose bugfixes and improvements.

Changelog

To see what has changed visit our CHANGELOG.md.

License

This project is licensed under the terms of the MIT license.

About

Improve compatibility with prop-types in Jest by failing prop-types bug tests instead of ignoring them.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks