3.0.1 • Published 3 years ago

react-proptype-error-catcher v3.0.1

Weekly downloads
38
License
MIT
Repository
github
Last release
3 years ago

react-proptype-error-catcher

Causes React PropType errors to fail the test

Installation

Using npm:

$ npm install --save-dev react-proptype-error-catcher
or
$ yarn add -D react-proptype-error-catcher

Requirements

Usage

Enable always

in jest config (jest.config.js) add to setupFilesAfterEnv like:

setupFilesAfterEnv: [
  'react-proptype-error-catcher/register',
],

Or if using setupTests.js like for create-react-app (CRA) then add like

import 'react-proptype-error-catcher/register';

Per test setup

If wanted to only turn on per test use this pattern:

with jest and react-testing-library

import proptype_error_catcher from 'react-proptype-error-catcher'

proptype_error_catcher()

it('with normal props it should render without errors', () => {
  // test logic
})
3.0.1

3 years ago

3.0.0

3 years ago

2.0.0

4 years ago

1.1.3

4 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago