I have this kind of a mocha test:
describe \'sabah\', →
beforeEach →
@sabahStrategy = _.filter(@strats, { name: \'sabah2\' })[0]
.str
When I use Highland.js with a super simple test, Mocha catches the failing assert without any problem:
var _ = require("highland");
var fs = require("fs");
var assert = require("assert");
describe("test", function () {
it("test", function (done) {
var s = _([1, 2, 3, 4]);
s.pull(function (err, result) {
console.log(result);
assert(false);
done();
});
});
});
This suggests that the problem in your example is not Mocha, nor Highland.js. If the articleLinkStream
object (or articleSream
; it seems to change from snippet to snippet) is custom code then maybe that code is buggy and actually swallows exceptions rather than let them move up the stack.