botpress / messaging

Botpress messaging server
42 stars 37 forks source link

chore(tests): major refactor and improvements around our test setup #479

Closed laurentlp closed 2 years ago

laurentlp commented 2 years ago

Sorry guy, this is a big one...

What I did was create a base test package that contains reusable utils that we copy-pasted across all our test suites. Also, all the setup and teardown files were shared and defined at the root of the repo. Since we now have many servers in the same repo (messaging, studio, and runtime), we don't want to be sharing the same setup for each package. That's why I moved those setup files under each package's test folder (e.g. packages/messaging/server/test/jest.e2e.setup.ts instead of being at test/jest.e2e.setup.ts). I also increased the timeouts for when we wait for the servers to start so that when the CI is slow, it doesn't fail while waiting for messaging to start.