Virtual pet written in Javascript (ES6)
-
Clone it down
-
Open node
node
- Create instance of a new Pet
const Pet = require('./src/test1')
const PET_NAME = new Pet (' PET_NAME ')
- Functions
PET_NAME
reports vitalsPET_NAME.growUp
ages the pet by 1 yearPET_NAME.feed
feeds your petPET_NAME.walk
walks your pet, increasing fitnessPET_NAME.isAlive
checks whether the pet is alive
- 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
Install Jest:
npm install -D jest
To run the tests:
npm test -- test1
- Tom Dunn - breakfastmeansbreakfast
- Manchester Codes