#Where to store tests when testing across multiple projects

3 messages · Page 1 of 1 (latest)

wheat crag
#

Hello! 🙂

I have a monorepo with a few nestjs projects, although quite separated have some public calls across them. I would like to be able to test from a users point of view which means spinning up all the projects and calling API endpoints. I can see examples for supertest within the root of a project for E2E testing however I was wondering if anyone has taken it a step back and E2E tests multiple API projects at once?

Would something like this belong in its own E2E testing package within a monorepo?

Thanks!

cunning shadow
#

What I would do (and kind of do in an nx monorepo) is create an "e2e application" that is responsible for calling your server(s) and asserting responses. It lives in the same top level directory as my other applications ~/apps and has it's own startup command that can be used to actually run the tests after starting up the other applications and running database migrations.

For sending and asserting requests, I use a tool called pactum

wheat crag