D
D
DieZz2017-04-10 12:10:02
Unit testing
DieZz, 2017-04-10 12:10:02

How to test routes in ExpressJS?

Good afternoon. Tell me how to cover routes with tests. For example, with such a request, such and such a route returned status 200, for example. Or, such and such a route contains such and such parameters in the response body.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Kitmanov, 2017-04-10
@DieZz

https://www.npmjs.com/package/supertest

S
sim3x, 2017-04-10
@sim3x

Functional tests - route returned a page with these tags
Unit tests - route returned this function + status + used this template / returned json

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question