"A cat has absolute emotional honesty. Human beings, for one reason or another, may hide their feelings, but a cat does not." ~Ernest Hemingway
A solution to a simple problem question that uses an assert Class that has two requirements:
- use of closure, and
- cats
Both of the above can be found in the CatTest.js class file. I demonstrate the use of closure in the trackResults method of this file. Its use is just a simple way to keep track of the number of times it has been called. Not probably the most practical implementation, but it is demonstrative.
ASCII versions of Grumpy Cat saying 'YEP' or 'NOPE' are included. In the program, they are read using 'fs' in the CatTest class.
This program can be run from the command line with node.js installed:
node index.js