Skip to content

Commit

Permalink
Published 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
richardguerre committed Jun 22, 2023
1 parent 58b13e4 commit 48d53df
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
15 changes: 14 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,25 @@ use-relay-mock-environment / [Modules](modules.md)

# use-relay-mock-environment

A super easy way to test Relay Components in Storybook or in dummy pages.
Next-level auto mocking for Relay components. Minimal code required.

Instead of having to specify resolvers for each individual field or going with the default (i.e. `<mock-value-1>`), this hook will automatically guess what type/category each field is and will use [faker.js](https://www.npmjs.com/package/faker) to generate fake data for you. Letting you focus on what matters most, which is building great UI/UX.

[![Version](https://img.shields.io/npm/v/use-relay-mock-environment.svg)](https://npmjs.org/package/use-relay-mock-environment)
[![Downloads/week](https://img.shields.io/npm/dw/use-relay-mock-environment.svg)](https://npmjs.org/package/use-relay-mock-environment)
[![License](https://img.shields.io/npm/l/use-relay-mock-environment.svg)](https://github.com/richardguerre/use-relay-mock-environment/blob/master/package.json)

## Installation
Install the library and relay-test-utils. Make sure you use the relay-test-utils version corresponding to your react-relay.

```
yarn add -D use-relay-mock-environment relay-test-utils
```
OR
```
npm i --save-dev use-relay-mock-environment relay-test-utils
```

## How does it work?

The hook does three main things:
Expand Down
10 changes: 5 additions & 5 deletions docs/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const mockData = {

#### Defined in

[src/index.ts:100](https://github.com/richardguerre/use-relay-mock-environment/blob/9aa610b/src/index.ts#L100)
[src/index.ts:100](https://github.com/richardguerre/use-relay-mock-environment/blob/58b13e4/src/index.ts#L100)

___

Expand Down Expand Up @@ -73,7 +73,7 @@ You can specify one or more of the following:

#### Defined in

[src/index.ts:29](https://github.com/richardguerre/use-relay-mock-environment/blob/9aa610b/src/index.ts#L29)
[src/index.ts:29](https://github.com/richardguerre/use-relay-mock-environment/blob/58b13e4/src/index.ts#L29)

___

Expand All @@ -85,7 +85,7 @@ Same as the `RelayMockOptions` below.

#### Defined in

[src/index.ts:242](https://github.com/richardguerre/use-relay-mock-environment/blob/9aa610b/src/index.ts#L242)
[src/index.ts:242](https://github.com/richardguerre/use-relay-mock-environment/blob/58b13e4/src/index.ts#L242)

___

Expand All @@ -111,7 +111,7 @@ ___

#### Defined in

[src/index.ts:106](https://github.com/richardguerre/use-relay-mock-environment/blob/9aa610b/src/index.ts#L106)
[src/index.ts:106](https://github.com/richardguerre/use-relay-mock-environment/blob/58b13e4/src/index.ts#L106)

## Functions

Expand Down Expand Up @@ -169,4 +169,4 @@ a function that is the `useRelayMockEnvironment()` React hook. Read more about i

#### Defined in

[src/index.ts:264](https://github.com/richardguerre/use-relay-mock-environment/blob/9aa610b/src/index.ts#L264)
[src/index.ts:264](https://github.com/richardguerre/use-relay-mock-environment/blob/58b13e4/src/index.ts#L264)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.6.0",
"version": "1.7.0",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down

0 comments on commit 48d53df

Please sign in to comment.