johnpooch / rtk-query-example-app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RTK Query Example App

This is an example app to demonstrate adding basic tests to a simple RTK Query implementation.

Tests

  • The test script here provides an approach for adding basic tests to your RTK Query service. The tests cover success and error scenarios a query endpoint and a mutation endpoint.
  • The test script here provides an approach for adding tests for your RTK Query service's automatically generated React hooks.
  • There are some other tests which demonstrate testing basic redux functionality like selectors and actions.

Prerequisites

Install dev requirements by running yarn in the project root.

Running the tests

In the project root run yarn test.

Starting the app

This project includes a very primitive applcation which exercises the RTK Query implementation. The implementation uses MSW as a mock service. You can alter the behavior of the mock service here

In the project root run yarn start. The application will be available on port 3000 by default.

About


Languages

Language:TypeScript 61.5%Language:JavaScript 33.3%Language:HTML 5.2%