我有这个异步mocha测试,我返回一个错误对象来指示错误:
describe "error object", →
it "should fail", (done) →
done(new Error({link: "mock" }))
这是输出:
1) error object should fail:
Error: [object Object]
我希望看到细节:
1) error object should fail:
Error: { link: "mock" }
如何在mocha测试中看到详细的错误输出?
答案 0 :(得分:0)
describe "error object",
it "should fail", (done)
done(new Error(JSON.stringify({link: "mock" })));