/virtual-pet

Virtual pet written in Javascript (ES6)

Primary LanguageJavaScript

Tom's Virtual Pet

Virtual pet written in Javascript (ES6)

Installing

  1. Clone it down

  2. Open node

node
  1. Create instance of a new Pet
const Pet = require('./src/test1')
const PET_NAME  = new Pet (' PET_NAME ')

  1. Functions
  • PET_NAME reports vitals
  • PET_NAME.growUp ages the pet by 1 year
  • PET_NAME.feed feeds your pet
  • PET_NAME.walk walks your pet, increasing fitness
  • PET_NAME.isAlive checks whether the pet is alive
  1. Global variables

By default, your pet will die upon turning age 30, getting too hunry and getting unfit. You can change these variables by modifying src/test1.js

Running the tests

Install Jest:

npm install -D jest

To run the tests:

npm test -- test1

Built With

Authors

Acknowledgments

  • Manchester Codes