I want to start a server and run tests on its API with Jasmine.
For that I want to make sure that the server is setup and running before jasmine runs its tests.
Also I have a lot of tests, and I split them into mutliple files.
I dont want to particularly start the server in the beforeAll hook of each test file, as it leads to conflicts on the port the server is running.
I thought of 2 theoretical Solutions that I dont know how to do with Jasmine.
- To have a global before/after script to the jasmine command which is executed before/after all test-files.
- To have a way to import all test Files into on Jasmine file where I can do my setup in the beforeAll as we all know it. However I dont know how to properly import those files and it also makes them all dependent on my mainTest-file. Meaning I cant execute them singularly.
Additional Info: Im in a node.js environment running a express-server and am testing its api (each route gets its test file)