How can I test my Express app without running a live server? #5204
-
In many web frameworks, it is possible to perform integration testing on an app without spinning up a live server (see docs from Flask, Fastify and Laravel). Simulating the network rather than actually sending requests over localhost can have a significant performance improvement. For example, in a benchmark I made, using Flask's test client was nearly 5x faster (3 seconds) than sending real requests with the However, when using Express, I have not been able to find a way to achieve this. Libraries like How can I perform simulated requests to an Express server, rather than starting the server and requesting to it over localhost? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello! The module light-my-request works with almost every Node.js web framework, including Express.js. can you ellabor on what ias you are having using it with Express.js? I know you referenced an issue for several years ago but AFAIK fixes have been made to light-my-request since. Are you still having the same issue? What kind of error are you getting when using it with Express.js? |
Beta Was this translation helpful? Give feedback.
Hello! The module light-my-request works with almost every Node.js web framework, including Express.js. can you ellabor on what ias you are having using it with Express.js? I know you referenced an issue for several years ago but AFAIK fixes have been made to light-my-request since. Are you still having the same issue? What kind of error are you getting when using it with Express.js?