Skip to content

Sample integration tests implementation for a common react app structure

License

Notifications You must be signed in to change notification settings

AntonRublev360/react-app-integration-tests-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-app-integration-tests-sample

Sample integration tests implementation for a common react app structure

Read more about the the project and reasoning here.

App implementation details

Goal of the app implementation is follow a common react app structure and patterns while keeping it simple and small for ease of reading and understanding.

The app implements a simple use case:

  1. User enters a GitHub username
  2. App displays a list of public repositories associated with the entered username

The app includes:

The project was bootstrapped with Create React App.

Integration tests

Integration tests are written from User perspective and ignore as much of implementation details as possible. Instead, tests assert that user can interact with the DOM to fulfill a certain scenario.

Integration tests are written using:

  • jest: JavaScript testing framework
  • react-testing-library: Simple and complete React DOM testing utilities that encourage good testing practices.
  • jest-dom: Custom jest matchers to test the state of the DOM.
  • nock: HTTP server mocking and expectations library.

About

Sample integration tests implementation for a common react app structure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published