https://github.com/remrkabledev/react-testing-jest-enzyme
Testing of react app using Jest + Enzyme
https://github.com/remrkabledev/react-testing-jest-enzyme
Last synced: 11 months ago
JSON representation
Testing of react app using Jest + Enzyme
- Host: GitHub
- URL: https://github.com/remrkabledev/react-testing-jest-enzyme
- Owner: reMRKableDev
- Created: 2020-03-13T09:05:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-21T20:36:31.000Z (over 1 year ago)
- Last Synced: 2024-10-30T08:17:32.597Z (over 1 year ago)
- Language: JavaScript
- Size: 639 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Testing React App with Jest + Enzyme
Applying testing principles to a React app that fetches users data from [JSONPlaceholder API](https://jsonplaceholder.typicode.com/users)
## Frameworks and Tools
Utilizing Jest and Enzyme for the testing of functions and components in the app
[Jest](https://jestjs.io/) - a JavaScript testing framework.
```javascript
test("test description", () => {
// Test goes here
})
```
[Enzyme](https://enzymejs.github.io/enzyme/) - a JavaScript Testing utility for React that makes it easier to test React Components' output.
```javascript
shallow() - gives a light-weight representation of what a component renders
render() - gives the HTML rendered output of my component.
mount() - gives a full DOM representation of my component. Useful for testing DOM events such as onClick, onSubmit, etc...
```
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
### Prerequisites
What things you need installed on your local machine.
```
Text editor (I use VSCode)
NPM
Git
```
### How To:
To use the app:
```
1. Fork and/or Clone repo.
2. Run 'npm install' on your local repo so as to get the required dependencies.
3. Run tests with 'npm test'.
4. Launch working app with 'npm start'
```
Have fun :)