Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

learning-zone/react-unit-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

18 Commits

Repository files navigation

React Unit Testing using Jest

Click ★ if you like the project. Your contributions are heartily ♡ welcome.


Testing React using Jest and Enzyme

Installation

# Package Installation
npm install
# Run the Project
npm start
# Project Test
npm test
# Generate Code Coverage Report
npm run test -- --coverage --watchAll=false

Project Covers

  • Component Testing
  • Props Testing
  • Snapshot Testing
  • Event Testing
  • Mocking function
  • Rest API Testing

Folder Structure

 + src
 + components
 + Events
	 + __snapshots__
	 - Events.js 
	 - Events.test.js
	 + Header
	 - Header.js
	 - Header.test.js
	 + Props
	 - Props.js
	 - Props.test.js
	 + RestAPI
	 - RestAPI.js
	 - RestAPI.test.js
 + __mocks__
 - axios.js

Code Coverage Report

|File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
|------------------------|----------|----------|----------|----------|-------------------|
|All files | 88.89 | 0 | 75 | 88.24 | |
| src | 100 | 100 | 100 | 100 | |
| App.js | 100 | 100 | 100 | 100 | |
| src/Components/Events | 50 | 0 | 33.33 | 50 | |
| Events.js | 50 | 0 | 33.33 | 50 | 14,16 |
| src/Components/Header | 100 | 100 | 100 | 100 | |
| Header.js | 100 | 100 | 100 | 100 | |
| src/Components/Props | 100 | 100 | 100 | 100 | |
| Props.js | 100 | 100 | 100 | 100 | |
| src/Components/RestAPI | 100 | 100 | 80 | 100 | |
| RestAPI.js | 100 | 100 | 80 | 100 | |
|------------------------|----------|----------|----------|----------|-------------------|

Technology

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /