how to run unit tests with better-assert and mocha?
Problem
I'm trying to run some unit tests with Mocha + better-assert but better-assert
uses an undefined variable __stack, and so it throws a reference error.
I'm new to the entire node.js stack, and despite some searching I'm not able to find out if this __stack
variable is something that comes from the v8 runtime, or from node.js, or mocha, or something else. grepping hasn't been fruitful.
using node v0.8.18, mocha 1.8.1, better-assert 0.1.0
where is the __stack
variable defined?
Solution
TJ Holowaychuk, the author of better-asset, just updated it with a fix for this exact problem. And by "just" I mean within an hour of you posting your question! If you update to the latest version of the module you shouldn't get the error any more.
Here are the details of the change if you are interested.
Discussion
View additional discussion.