Fixing test cases.
This commit is contained in:
parent
56f1170ae9
commit
66e3e3b7a4
|
@ -25,8 +25,8 @@ describe("/accesslevels", () => {
|
|||
({ request, server } = await supertest())
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
server.close(done)
|
||||
afterAll(() => {
|
||||
server.close()
|
||||
})
|
||||
|
||||
beforeEach(async () => {
|
||||
|
|
|
@ -18,8 +18,8 @@ describe("/applications", () => {
|
|||
await clearApplications(request)
|
||||
})
|
||||
|
||||
afterAll(done => {
|
||||
server.close(done)
|
||||
afterAll(() => {
|
||||
server.close()
|
||||
})
|
||||
|
||||
describe("create", () => {
|
||||
|
|
|
@ -53,8 +53,8 @@ describe("/automations", () => {
|
|||
if (automation) await destroyDocument(automation.id)
|
||||
})
|
||||
|
||||
afterAll(done => {
|
||||
server.close(done)
|
||||
afterAll(() => {
|
||||
server.close()
|
||||
})
|
||||
|
||||
const createAutomation = async () => {
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -14,8 +14,8 @@ describe("/instances", () => {
|
|||
TEST_APP_ID = (await createApplication(request))._id
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
server.close(done)
|
||||
afterAll(() => {
|
||||
server.close()
|
||||
})
|
||||
|
||||
describe("create", () => {
|
||||
|
|
|
@ -18,8 +18,8 @@ describe("/rows", () => {
|
|||
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
server.close(done)
|
||||
afterAll(() => {
|
||||
server.close()
|
||||
})
|
||||
|
||||
beforeEach(async () => {
|
||||
|
|
|
@ -17,8 +17,8 @@ describe("/tables", () => {
|
|||
({ request, server } = await supertest())
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
server.close(done)
|
||||
afterAll(() => {
|
||||
server.close()
|
||||
})
|
||||
|
||||
beforeEach(async () => {
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -42,8 +42,8 @@ describe("/views", () => {
|
|||
instanceId = app.instances[0]._id
|
||||
})
|
||||
|
||||
afterAll(done => {
|
||||
server.close(done)
|
||||
afterAll(() => {
|
||||
server.close()
|
||||
})
|
||||
|
||||
describe("create", () => {
|
||||
|
|
Loading…
Reference in New Issue