jest-react-shallow-equal
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

jest-react-shallow-equal

Unit test against inadvertent performance problems.

Provides a toShallowEqual matcher for jest. This matcher can aid in writing performant code as it allows you to write unit tests which ensure that shallowEqual always returns true when the underlying values tested have not changed.

Usage

The tests give examples of how to use this to test mapStateToProps and higher-order components (HOCs).

Install

npm install --save-dev jest-react-shallow-equal
import installShallowEqualMatcher from 'jest-react-shallow-equal'
 
installShallowEqualMatcher()
 
test('should x when y', () => {
  // ...
})

Readme

Keywords

none

Package Sidebar

Install

npm i jest-react-shallow-equal

Weekly Downloads

0

Version

0.2.1

License

MIT

Last publish

Collaborators

  • sebinsua