diff --git a/packages/server/src/api/routes/tests/accesslevel.spec.js b/packages/server/src/api/routes/tests/accesslevel.spec.js index 4f27bc8bc0..1bc540c046 100644 --- a/packages/server/src/api/routes/tests/accesslevel.spec.js +++ b/packages/server/src/api/routes/tests/accesslevel.spec.js @@ -25,8 +25,8 @@ describe("/accesslevels", () => { ({ request, server } = await supertest()) }); - afterAll(done => { - server.close(done) + afterAll(() => { + server.close() }) beforeEach(async () => { diff --git a/packages/server/src/api/routes/tests/application.spec.js b/packages/server/src/api/routes/tests/application.spec.js index cbf84691e3..179aa1b3ca 100644 --- a/packages/server/src/api/routes/tests/application.spec.js +++ b/packages/server/src/api/routes/tests/application.spec.js @@ -18,8 +18,8 @@ describe("/applications", () => { await clearApplications(request) }) - afterAll(done => { - server.close(done) + afterAll(() => { + server.close() }) describe("create", () => { diff --git a/packages/server/src/api/routes/tests/automation.spec.js b/packages/server/src/api/routes/tests/automation.spec.js index c28542c348..6bda1b7708 100644 --- a/packages/server/src/api/routes/tests/automation.spec.js +++ b/packages/server/src/api/routes/tests/automation.spec.js @@ -53,8 +53,8 @@ describe("/automations", () => { if (automation) await destroyDocument(automation.id) }) - afterAll(done => { - server.close(done) + afterAll(() => { + server.close() }) const createAutomation = async () => { diff --git a/packages/server/src/api/routes/tests/couchTestUtils.js b/packages/server/src/api/routes/tests/couchTestUtils.js index 12f9e11908..df50e3cd7c 100644 --- a/packages/server/src/api/routes/tests/couchTestUtils.js +++ b/packages/server/src/api/routes/tests/couchTestUtils.js @@ -15,12 +15,12 @@ const TEST_CLIENT_ID = "test-client-id" exports.TEST_CLIENT_ID = TEST_CLIENT_ID exports.supertest = async () => { let request - let app + let server env.PORT = 4002 - app = require("../../../app") + server = require("../../../app") - request = supertest(app) - return { request, app } + request = supertest(server) + return { request, server } } exports.defaultHeaders = instanceId => { diff --git a/packages/server/src/api/routes/tests/instance.spec.js b/packages/server/src/api/routes/tests/instance.spec.js index 86fd4b8920..180d7f44e6 100644 --- a/packages/server/src/api/routes/tests/instance.spec.js +++ b/packages/server/src/api/routes/tests/instance.spec.js @@ -14,8 +14,8 @@ describe("/instances", () => { TEST_APP_ID = (await createApplication(request))._id }); - afterAll(done => { - server.close(done) + afterAll(() => { + server.close() }) describe("create", () => { diff --git a/packages/server/src/api/routes/tests/row.spec.js b/packages/server/src/api/routes/tests/row.spec.js index 31098c51e4..bd447513f3 100644 --- a/packages/server/src/api/routes/tests/row.spec.js +++ b/packages/server/src/api/routes/tests/row.spec.js @@ -18,8 +18,8 @@ describe("/rows", () => { }); - afterAll(done => { - server.close(done) + afterAll(() => { + server.close() }) beforeEach(async () => { diff --git a/packages/server/src/api/routes/tests/table.spec.js b/packages/server/src/api/routes/tests/table.spec.js index 388e76f52a..0c0f64050f 100644 --- a/packages/server/src/api/routes/tests/table.spec.js +++ b/packages/server/src/api/routes/tests/table.spec.js @@ -17,8 +17,8 @@ describe("/tables", () => { ({ request, server } = await supertest()) }); - afterAll(done => { - server.close(done) + afterAll(() => { + server.close() }) beforeEach(async () => { diff --git a/packages/server/src/api/routes/tests/user.spec.js b/packages/server/src/api/routes/tests/user.spec.js index 59a13ae8b4..010f735c4a 100644 --- a/packages/server/src/api/routes/tests/user.spec.js +++ b/packages/server/src/api/routes/tests/user.spec.js @@ -26,6 +26,11 @@ describe("/users", () => { instanceId = app.instances[0]._id }); + afterAll(() => { + server.close() + server.destroy() + }) + describe("fetch", () => { it("returns a list of users from an instance db", async () => { await createUser(request, instanceId, "brenda", "brendas_password") diff --git a/packages/server/src/api/routes/tests/view.spec.js b/packages/server/src/api/routes/tests/view.spec.js index 316014fa34..ec30f10f3f 100644 --- a/packages/server/src/api/routes/tests/view.spec.js +++ b/packages/server/src/api/routes/tests/view.spec.js @@ -42,8 +42,8 @@ describe("/views", () => { instanceId = app.instances[0]._id }) - afterAll(done => { - server.close(done) + afterAll(() => { + server.close() }) describe("create", () => {