I'm writing a mocha clone, because mocha is lacking certain features that I need. But when I am using existing assertion libraries, I'm unable to catch errors that are returned by them. Here is the code that runs the tests.
Tester.Test = function(name, test_function) {
this.name = name;
this.run = function(callback) {
try {
test_function(callback);
} catch (e) {
callback(e);
}
};
};
I've already tried using domain
to catch the error, but it's still not working:
var d = domain.create();
d.on("error", function(err) {
cb(err);
});
d.run(function() {
test.run(cb);
});
I still keep getting an AssertionError
(expected false to be true). Any tips?
Aucun commentaire:
Enregistrer un commentaire