Command Shift

Getting Older, Getting Unhealthier - ;TLDR

Now that your pet can get older, it can also begin to feel the effects of age.

Your challenge in this step is to adapt the Pet function so that growing up also makes it hungrier and less fit.

This can be broken down into steps:

  • The Pet should have an initial hunger of 0

  • The growUp method should increase the hunger property by 5

  • The Pet should have an initial fitness of 10

  • The growUp method should decrease the fitness property by 3

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

Once you are done, commit your work and push to GitHub

On this page