我在如何使用 Vows 为我的 Promise-returning API 正确构建测试时遇到问题,例如
topic:function() { return myfunc() { /* returns a Bluebird Promise */ } },
'this should keep its promise':function(topic) {
var myfunc = topic;
myfunc()
.then(function(result) {
assert(false);
})
.catch(function(error) {
assert(false);
})
.done();
}
我的誓言永不落空。这是我第一次尝试使用 vows 来测试 Promise。希望熟悉这方面的人伸出援助之手。
提前谢谢你。
恩里克