0.1.20 • Published 3 years ago

@pepfar-react-lib/jest-tools v0.1.20

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

REACT Test Utils

Repo Owner: Ben Guaraldi @benguaraldi

This super-light library will help you write your REACT tests much more effectively.

It is designed for developers using REACT, Jest & Material-UI

Why this library?

Jest is awesome!
But it can be a bit elaborate to do basic tasks.
This library focuses on REACT + Jest used case and is inspired by super handy Cypress commands.

@pepfar-react-lib/jest-tools should help you write your tests much faster and make them much more readable. Disagree? Submit an issue in our repo!

Example:

Instead of:

// picks an option from select menu
fireEvent.mouseDown(screen.getByTestId(selectId).childNodes[0]);
screen.getByText(value);
fireEvent.click(screen.getByText(value));
checkSelectValue(selectId, value);

you can just write:

// does the same as example above
select(selectId, value);

Installation

npm i @pepfar-react-lib/jest-tools

Usage

import {select} from "@pepfar-react-lib/jest-tools";
// your code
select(selectId,value);

API

Full list of all methods in API docs

0.1.20

3 years ago

0.1.18

3 years ago

0.1.19

3 years ago

0.1.13

3 years ago

0.1.14

3 years ago

0.1.15

3 years ago

0.1.16

3 years ago

0.1.17

3 years ago

0.1.12

4 years ago

0.1.10

4 years ago

0.1.11

4 years ago

0.1.9

4 years ago