New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for promises in expect
#401
Comments
Pushed again to fix an issue with passing |
Would love to use this! |
Thank you @LegNeato! |
@LegNeato It seems the problem is not solved. I‘m using supertest@4.0.2. I find that the AssertionError will not be detected when I use async/await in expect. .expect(async res => {
const orderId = res.body.orderId;
const order = await Order.findById(orderId).lean(); // { price: 10 }
// the AssertionError will not be detected
order.should.deepEqual({
price: 50
});
}); |
@LegNeato, I'm afraid the problem is still there yet. I also need to call an async method there too! Is there a workaround for that? Thanks |
I don't know, it could have regressed since this was landed years ago. I only use Rust these days so sadly can't help. |
Right now, if you have a promise in
expect
(for, say, an async function) it will be run but errors will not be detected.The text was updated successfully, but these errors were encountered: