Speeding up server tests and removing the ability for it to port collide.
This commit is contained in:
parent
9b172bfa27
commit
d90f77fa42
File diff suppressed because it is too large
Load Diff
|
@ -6,3 +6,4 @@ env._set("JWT_SECRET", "test-jwtsecret")
|
||||||
env._set("CLIENT_ID", "test-client-id")
|
env._set("CLIENT_ID", "test-client-id")
|
||||||
env._set("BUDIBASE_DIR", tmpdir("budibase-unittests"))
|
env._set("BUDIBASE_DIR", tmpdir("budibase-unittests"))
|
||||||
env._set("LOG_LEVEL", "silent")
|
env._set("LOG_LEVEL", "silent")
|
||||||
|
env._set("PORT", 0)
|
||||||
|
|
|
@ -26,7 +26,8 @@ const PASSWORD = "babs_password"
|
||||||
class TestConfiguration {
|
class TestConfiguration {
|
||||||
constructor(openServer = true) {
|
constructor(openServer = true) {
|
||||||
if (openServer) {
|
if (openServer) {
|
||||||
env.PORT = 4002
|
// use a random port because it doesn't matter
|
||||||
|
env.PORT = 0
|
||||||
this.server = require("../../app")
|
this.server = require("../../app")
|
||||||
// we need the request for logging in, involves cookies, hard to fake
|
// we need the request for logging in, involves cookies, hard to fake
|
||||||
this.request = supertest(this.server)
|
this.request = supertest(this.server)
|
||||||
|
|
Loading…
Reference in New Issue