In this course we want to focus on important testing techniques and practices. I'll avoid talking about
test configuration. If you don't have project to play with you can use the following
repository templatewhere you have:
I'll use that template in whole course. In addition you can read this
articlewhere we explain
mentioned repo. If you have your own app and tests configured - it's even better. You can try practices in your project and master them perfectly 📜.
Running first time
repositoryand click use template. After creating repo just clone it. Then type
npm install --legacy-peer-depsand use commands which you want. You can find them in
README.mdfile. They're are also explained below.
How to run storybook for UI lib?
cd .system // changes directory npx nx run figa-ui:storybook // runs storybook for UI library.
How to run tests?
cd .system // changes directory npx nx run-many --target=test --projects=figa-hooks --watch // runs tests for figa-hooks library. npx nx run-many --target=test --projects=figa-ui,figa-hooks --watch // runs tests for many libs. npx nx run-many --target=test --watch // runs tests for every lib and app in monorepo.
How to run apps?
cd .system // changes directory npx nx run-many --target=serve --all // runs all apps in monorepo. npx nx run-many --parallel --target=serve --projects=blog,blog-creator // runs specified apps in monorepo.
- 1. Basics
Grouping the tests
The usage of describe and it
The best practices for naming tests
Types of tests
- 2. Mastering unit testing