Trying to use Mocha for unit testing. The Getting Started instructions are straightforward enough at first:
All great, so far. But then, "Back in the terminal":
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
to no avail. Edit:
The module does not load
(I had said it does). Running
does work, but that does me no good. I can run Array().indexOf(), but that has nothing to do with my testing.
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?
: Also tried
also with no joy.
: just got a clue that Array().indexOf() is just JS code, having nothing to do with mocha or the assert module. But still, no luck with mocha.
: As for there already being an answer to this question, there is no way I could have known that this was about a reference error. Reference error was only one of many failures that occurred during my wild grasping. The real problem is that the mocha instructions are not clear, and that makes this question totally different from the one about the reference error.