Trying to use Mocha for unit testing. The Getting Started instructions are straightforward enough at first:
- Install Mocha with
npm install mocha - Create a file called test.js
- Edit the file and paste (some predefined stuff) into it
All great, so far. But then, "Back in the terminal":
Array
#indexOf
...etc
Ok, I'm totally baffled. Obviously, it doesn't mean to type this on the command line. But I tried running node and doing a require('<test file>'); to no avail. It just says the function describe is not defined. What does this last instruction really mean? What am I really supposed to do to get this framework going so I can use it for unit testing?
Aucun commentaire:
Enregistrer un commentaire