This repository contains some examples about using the Testing Library to test React components and hooks.
This small application shows Bitcoin prices fetched from the Coindeks API. You can run the app using the following commands
$ npm i
$ npm start
You'll find the test files in:
└── src
├── App.int.test.js
├── components
│ └── PriceDisplay.unit.test.js
└── hooks
└── useBtcPrice.unit.test.js
The .int.test.js
files are integration tests, the .unit.test.js
files contain
integration tests.
You can use the following command to run all or some tests:
$ npm test
$ npm run test:unit
$ npm run test:int
You can also use the following commands to view the code coverage:
$ npm run test:coverage
$ npm run test:coverage:unit
$ npm run test:coverage:int