Close server back
This commit is contained in:
parent
505146f4b3
commit
c5da1a06c6
|
@ -238,11 +238,11 @@ export default class TestConfiguration {
|
|||
return
|
||||
}
|
||||
|
||||
// if (this.server) {
|
||||
// this.server.close()
|
||||
// } else {
|
||||
// require("../../app").getServer().close()
|
||||
// }
|
||||
if (this.server) {
|
||||
this.server.close()
|
||||
} else {
|
||||
require("../../app").getServer().close()
|
||||
}
|
||||
if (this.allApps) {
|
||||
cleanup(this.allApps.map(app => app.appId))
|
||||
}
|
||||
|
|
|
@ -12,21 +12,28 @@ const BASE_IDENTITY = {
|
|||
const USER_AUDIT_LOG_COUNT = 3
|
||||
const APP_ID = "app_1"
|
||||
|
||||
const config = new TestConfiguration()
|
||||
|
||||
beforeAll(async () => {
|
||||
await config.beforeAll()
|
||||
})
|
||||
afterAll(async () => {
|
||||
await config.afterAll()
|
||||
})
|
||||
|
||||
describe.each(["lucene", "sql"])("/api/global/auditlogs (%s)", method => {
|
||||
const config = new TestConfiguration()
|
||||
let envCleanup: (() => void) | undefined
|
||||
|
||||
beforeAll(async () => {
|
||||
envCleanup = features.testutils.setFeatureFlags("*", {
|
||||
SQS: method === "sql",
|
||||
})
|
||||
await config.beforeAll()
|
||||
|
||||
await config.useNewTenant()
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
afterAll(() => {
|
||||
envCleanup?.()
|
||||
await config.afterAll()
|
||||
})
|
||||
|
||||
describe("POST /api/global/auditlogs/search", () => {
|
||||
|
|
|
@ -12,7 +12,7 @@ dbConfig.init()
|
|||
import env from "../environment"
|
||||
import * as controllers from "./controllers"
|
||||
|
||||
const supertest = require("supertest")
|
||||
import supertest from "supertest"
|
||||
|
||||
import { Config } from "../constants"
|
||||
import {
|
||||
|
@ -123,11 +123,11 @@ class TestConfiguration {
|
|||
}
|
||||
|
||||
async afterAll() {
|
||||
// if (this.server) {
|
||||
// await this.server.close()
|
||||
// } else {
|
||||
// await require("../index").default.close()
|
||||
// }
|
||||
if (this.server) {
|
||||
await this.server.close()
|
||||
} else {
|
||||
await require("../index").default.close()
|
||||
}
|
||||
}
|
||||
|
||||
// TENANCY
|
||||
|
|
Loading…
Reference in New Issue