Keeping Fed - ;TLDR
We also want to counteract our pets getting hungry.
Your challenge in this step is to give the Pet
function a feed
method that decreases it's hunger level.
-
calling
feed
should decrease the Pet's hunger level by3
. -
A pet's hunger level should never go below
0
.
To complete this challenge, you will need to:
-
test the expected behaviour in the Node CLI
-
write unit tests to to cover the expected behaviour
-
implement the code to make the tests pass
-
refactor your code
Once you are done, commit your work and push to GitHub.