Speeding up server tests and removing the ability for it to port collide.

This commit is contained in:
mike12345567 2021-06-25 16:14:06 +01:00
parent b379a1e3d3
commit f0e7b9b25e
3 changed files with 11 additions and 1004 deletions

File diff suppressed because it is too large Load Diff

View File

@ -6,3 +6,4 @@ env._set("JWT_SECRET", "test-jwtsecret")
env._set("CLIENT_ID", "test-client-id")
env._set("BUDIBASE_DIR", tmpdir("budibase-unittests"))
env._set("LOG_LEVEL", "silent")
env._set("PORT", 0)

View File

@ -26,7 +26,8 @@ const PASSWORD = "babs_password"
class TestConfiguration {
constructor(openServer = true) {
if (openServer) {
env.PORT = 4002
// use a random port because it doesn't matter
env.PORT = 0
this.server = require("../../app")
// we need the request for logging in, involves cookies, hard to fake
this.request = supertest(this.server)