2.0.0 • Published 5 years ago

rut v2.0.0

Weekly downloads
43
License
MIT
Repository
github
Last release
5 years ago

Rut

Build Status npm version npm deps

Rut is a DOM-less React testing library that aims to be lightweight, encourage great testing practices, and reduce flakiness and code smells. It is a wrapper and abstraction around react-test-renderer that simplifies the test writing process, while doing all the hard work behind the scenes.

This package provides core functionality for adapters to expand upon. For example, a DOM adapter for react-dom, a mobile native adapter for react-native, or even a custom adapter unique to your application.

Features

  • Type safe by design. Test with confidence.
  • First-class async support. Wait for async calls to finish before returning a rendered result. (Experimental)
  • Deep act() integration. Let Rut do the heavy lifting.
  • Update a component with new props, children, or a completely new element.
  • Unmount a component to verify cleanup and destructor based logic.
  • Dispatch DOM level events with a mocked synthetic event (and propagation coming soon!).
  • Wrap all renders with a defined wrapping component and or React.StrictMode.
  • Apply pre-built mocks for robust and accurate testing.
  • Utilize an array of pre-built matchers for easily querying, expecting, and asserting.

Requirements

  • React 16.9+ (Rut v1)
  • React 17+ (Rut v2)

Installation

yarn add --dev rut react

Documentation

https://milesj.gitbook.io/rut

2.0.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.9.2

5 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.8.2

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.3

6 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.4

6 years ago

0.6.3

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.6

12 years ago

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

13 years ago