'Mocking req.company.data[0].id object for MochaJS tests
I have a product id and that way it can be used for request.
req.product.data[0].id
What should I write here when I want to test it with mocha .set('---------')?
chai
.request(server)
.post("/login")
.auth(token, { type: "bearer" })
.set("req.product.data[0].id ", 1)
.end((err, res) => {
done();
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
