0
我正在运行此测试(简化),其失败如预期...但尽管失败,它仍然等待完整的20秒超时。我如何让它立即失败?摩卡/梦魇测试失败,但仍然等待超时
it("should fail before timeout", function (done) {
var nightmare = new Nightmare({ show: true })
.goto(url)
.evaluate(function() {
})
.then(function (result) {
// this point is reached, and then the test just waits
// 20 seconds before finally failing
throw "Fail"
})
})