I'm trying to write a test with Mocha, Chai and Supertest to check if a backend API throw a timeout error.
I'd like to have something like this
describe("timeout call", () => {
it("should return error 408", async () => {
await supertest(app).get(url)
.expect(408)
});
});
since the timeout error doesn't depend on parameters I pass to the API (it could occur if the user has a slow connection, for example), I'm not sure how to do that