RDD, CDD and TDD
Table of Contents
Being a Good Programmer Isn't Just About Writing Code.
It's also writing documentations, comments and unit tests.
- write the README.md and missing comments with JSDoc for the library cash
- write the Unit Tests for the library starwars
- Fork the project via `github`
- Clone your forked repository project `https://github.com/YOUR_USERNAME/3-musketeers`
❯ cd /path/to/workspace ❯ git clone git@github.com:YOUR_USERNAME/3-musketeers.git
- Do things
- Commit and push your different modifications
❯ cd /path/to/workspace/3-musketeers ❯ git add -A && git commit -m "docs(readme): add usage section" ❯ git push origin master
Note:
- why following a commit message convention?
- if you catch an error about authentication, add your ssh to your github profile.
- If you need some helps on git commands, read git - the simple guide
cash: RDD and CDD
Understand first the library features
❯ cd /path/to/workspace/3-musketeers/cash
❯ npm i
❯ node bin/index.js
# chech what's going on
# ...
- Complete the cash/README.md file with a complete description of installation, usage... of the library
- add JSDOC function block for the file cash/bin/cash.js
starwars: TDD
Understand first the library features
❯ cd /path/to/workspace/3-musketeers/starwars
❯ npm i
❯ node sandbox.js
# chech what's going on
# ...
- Run unit tests with
npm run test
- Complete the unit tests (with Jest as testing framework) file starwars/src/index.test.js to cover at least 80%
About Jest
- Getting started with Jest
- Jest uses matchers to let you test values in different ways.
- When you're writing tests, you often need to check that values meet certain conditions. expect gives you access to a number of
matchers
that let you validate different things.