Friday, 6 December 2019

Testing Routes with Supertest while keeping csurf intact?

I am trying to test the routes in my express backend with jest+supertest and run into problems with the csrf tokens. I am using a cookieparser for csurf and run into problems while running the tests. The suggestions from csurf documentation didn't work, and other solutions I found online suggest to disable csurf for testing, which I would rather not.How can I access the csrf-tokens in my tests?

Submitted December 06, 2019 at 04:28PM by Polcal

No comments:

Post a Comment