I am trying to run some tests using mocha but cant seem to get over this error.
E:\\tdd\\nodejs\\cart>mocha cart.test.js
node.js:201
throw e; // proc
You need to tell Mocha to use the TDD interface, instead of the default BDD one:
mocha --ui tdd card.test.js
You can also include a Makefile in your project and specify TDD like so:
test:
@./node_modules/.bin/mocha -u tdd
.PHONY: test
Hat tip: DailyJS
You can do the same by just specifying mocha -u tdd in package.json
"scripts": {
"start" : "node server",
"test": "mocha -u tdd"
}