vendredi 24 août 2018

Adding object to supertest

I'm trying to test one of my routes, which would usually expect an object on the request object (e.g. req.exampleData = { }).

I've tried looking for examples, but I've only found .set which attaches to the req header.

Ideally, I would want something like:

await request(app) .get('/api/testRoute) .attach('exampleData', { })

Is such a thing possible for supertest?

Aucun commentaire:

Enregistrer un commentaire