带有异步摩卡测试的详细错误日志
detailed error log with asynchronous mocha tests
我有这个异步 mocha 测试,其中我 return 一个错误对象来指示错误:
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 测试中查看详细的错误输出?
describe "error object",
it "should fail", (done)
done(new Error(JSON.stringify({link: "mock" })));
我有这个异步 mocha 测试,其中我 return 一个错误对象来指示错误:
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 测试中查看详细的错误输出?
describe "error object",
it "should fail", (done)
done(new Error(JSON.stringify({link: "mock" })));