An open API service indexing awesome lists of open source software.

https://github.com/alitaee/test-lab

Learning and Practicing unit test
https://github.com/alitaee/test-lab

jest reactjs testing-library unit-testing

Last synced: 5 months ago
JSON representation

Learning and Practicing unit test

Awesome Lists containing this project

README

          

# Test-lab

Learning and Practicing unit test in React and JavaScript.

## fundamentals folder ⚛️

In this folder you could find pure unit testing in JavaScript
and how we could create our own assertion library.

## src/components folder

In this folder you could see examples of unit testing for react components.

## src/hooks folder

In this folder you could see examples of unit testing for react custom hooks.

## src/redux folder

In this folder you could see examples of unit and integration testing for redux and react components.

## Available Scripts

In the project directory, you can run:

### `yarn start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `yarn test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

## Useful links 🔗

- [Testingjavascript.com](https://testingjavascript.com/)
- [But really, what is a JavaScript test?](https://kentcdodds.com/blog/but-really-what-is-a-javascript-test)
- [How to test a custom react hook](https://atomizedobjects.com/blog/react/how-to-test-a-custom-react-hook/)
- [Kentcdodds blog](https://kentcdodds.com/blog?q=testing)
- [Testing-library Queries](https://testing-library.com/docs/queries/about)
- [Testing-library guide-disappearance](https://testing-library.com/docs/guide-disappearance/)
- [Front-End Testing is For Everyone](https://css-tricks.com/front-end-testing-is-for-everyone/)
- [Common mistakes with React Testing Library](https://kentcdodds.com/blog/common-mistakes-with-react-testing-library)

## Redux

- [Writing Tests for Redux](https://redux.js.org/usage/writing-tests)
- [Testing Implementation Details](https://kentcdodds.com/blog/testing-implementation-details)

## Libraries 📚

- [Jestjs.io](https://jestjs.io/)
- [History](https://www.npmjs.com/package/history)
- [Jest-axe](https://github.com/nickcolley/jest-axe)
- [Testing-library.com](https://testing-library.com/)

## Tools 🛠️

- [Testing playground](https://chrome.google.com/webstore/detail/testing-playground/hejbmebodbijjdhflfknehhcgaklhano?hl=en)