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
- Write useful comments
- Complete the Unit Tests
for the library currency
- Fork the project via
github
- Clone your forked repository project
https://github.com/YOUR_USERNAME/3-musketeers
❯ cd /path/to/workspace
❯ git clone [email protected]:YOUR_USERNAME/3-musketeers.git
-
Do things: README.md, comments and complete unit tests
-
Commit your different modifications:
❯ cd /path/to/workspace/3-musketeers
❯ git add -A && git commit -m "docs(readme): add usage section"
❯ git push origin master
- Don't forget to commit early, commit often and push often
❯ git push origin master
Note: 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
Understand first the library features
❯ cd /path/to/workspace/3-musketeers/currency
❯ npm install # or yarn
❯ node cli.js
# chech what's going on and printed in the console
# ...
- Complete the currency/README.md file with a complete description of installation, usage... of the library
- Add block commments (use JSDoc format for instance) for the file currency/index.js only
- Run unit tests with
npm test
❯ npm test # or yarn test
# chech what's going on and printed in the console
# ...
- Complete the unit tests (with Jest as testing framework) file currency/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.