@akanjs/test 0.0.57 → 0.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/jest.testServer.js
CHANGED
|
@@ -55,7 +55,7 @@ class TestServer {
|
|
|
55
55
|
static initClient(env, workerId = parseInt(process.env.JEST_WORKER_ID ?? "0")) {
|
|
56
56
|
if (workerId === 0)
|
|
57
57
|
throw new Error("TestClient should not be used in main thread");
|
|
58
|
-
const portOffset = workerId * 1e3
|
|
58
|
+
const portOffset = workerId * 1e3;
|
|
59
59
|
const port = TEST_LISTEN_PORT_BASE + portOffset;
|
|
60
60
|
const endpoint = `http://localhost:${port}/backend/graphql`;
|
|
61
61
|
import_signal.client.init({ uri: endpoint });
|
|
@@ -64,7 +64,7 @@ class TestServer {
|
|
|
64
64
|
this.workerId = workerId ?? parseInt(process.env.JEST_WORKER_ID ?? "0");
|
|
65
65
|
if (this.workerId === 0)
|
|
66
66
|
throw new Error("TestServer should not be used in main thread");
|
|
67
|
-
this.#portOffset = this.workerId * 1e3
|
|
67
|
+
this.#portOffset = this.workerId * 1e3;
|
|
68
68
|
this.#mongod = new import_mongodb_memory_server.MongoMemoryServer({ instance: { port: TEST_MONGODB_PORT_BASE + this.#portOffset } });
|
|
69
69
|
this.#redis = new import_redis_memory_server.RedisMemoryServer({ instance: { port: TEST_REDIS_PORT_BASE + this.#portOffset } });
|
|
70
70
|
this.#env = { ...env };
|
package/src/jest.testServer.mjs
CHANGED
|
@@ -23,7 +23,7 @@ class TestServer {
|
|
|
23
23
|
static initClient(env, workerId = parseInt(process.env.JEST_WORKER_ID ?? "0")) {
|
|
24
24
|
if (workerId === 0)
|
|
25
25
|
throw new Error("TestClient should not be used in main thread");
|
|
26
|
-
const portOffset = workerId * 1e3
|
|
26
|
+
const portOffset = workerId * 1e3;
|
|
27
27
|
const port = TEST_LISTEN_PORT_BASE + portOffset;
|
|
28
28
|
const endpoint = `http://localhost:${port}/backend/graphql`;
|
|
29
29
|
client.init({ uri: endpoint });
|
|
@@ -32,7 +32,7 @@ class TestServer {
|
|
|
32
32
|
this.workerId = workerId ?? parseInt(process.env.JEST_WORKER_ID ?? "0");
|
|
33
33
|
if (this.workerId === 0)
|
|
34
34
|
throw new Error("TestServer should not be used in main thread");
|
|
35
|
-
this.#portOffset = this.workerId * 1e3
|
|
35
|
+
this.#portOffset = this.workerId * 1e3;
|
|
36
36
|
this.#mongod = new MongoMemoryServer({ instance: { port: TEST_MONGODB_PORT_BASE + this.#portOffset } });
|
|
37
37
|
this.#redis = new RedisMemoryServer({ instance: { port: TEST_REDIS_PORT_BASE + this.#portOffset } });
|
|
38
38
|
this.#env = { ...env };
|