Remove isDockerisedTest

This commit is contained in:
adrinr 2023-02-02 10:50:20 +00:00
parent 3328c908ff
commit a80fc4aaa8
5 changed files with 1 additions and 42 deletions

View File

@ -1,15 +1,4 @@
function isDockerisedTest() {
return process.env.DOCKERISED_TEST === "true"
}
function isTest() { function isTest() {
if (isDockerisedTest()) {
// While we are migrating all the tests to use docker instead of mocked in memory,
// we want to keep treating the old tests as tests,
// but the new tests should not make a difference
return false
}
return isCypress() || isJest() return isCypress() || isJest()
} }

View File

@ -74,7 +74,7 @@ server.on("close", async () => {
await events.shutdown() await events.shutdown()
await Thread.shutdown() await Thread.shutdown()
api.shutdown() api.shutdown()
if (!env.isTest() && !env.isDockerisedTest()) { if (!env.isTest()) {
process.exit(errCode) process.exit(errCode)
} }
}) })

View File

@ -1,17 +1,6 @@
import { join } from "path" import { join } from "path"
function isDockerisedTest() {
return process.env.DOCKERISED_TEST === "true"
}
function isTest() { function isTest() {
if (isDockerisedTest()) {
// While we are migrating all the tests to use docker instead of mocked in memory,
// we want to keep treating the old tests as tests,
// but the new tests should not make a difference
return false
}
return isCypress() || isJest() return isCypress() || isJest()
} }
@ -115,7 +104,6 @@ const environment = {
isInThread: () => { isInThread: () => {
return inThread return inThread
}, },
isDockerisedTest,
} }
// threading can cause memory issues with node-ts in development // threading can cause memory issues with node-ts in development

View File

@ -168,14 +168,6 @@ class TestConfiguration {
} }
if (this.allApps) { if (this.allApps) {
cleanup(this.allApps.map(app => app.appId)) cleanup(this.allApps.map(app => app.appId))
if (env.isDockerisedTest()) {
await this._req(
null,
{ appId: this.prodApp.appId },
controllers.app.destroy
)
}
} }
if (this.server) { if (this.server) {

View File

@ -4,17 +4,7 @@ function isDev() {
return process.env.NODE_ENV !== "production" return process.env.NODE_ENV !== "production"
} }
function isDockerisedTest() {
return process.env.DOCKERISED_TEST === "true"
}
function isTest() { function isTest() {
if (isDockerisedTest()) {
// While we are migrating all the tests to use docker instead of mocked in memory,
// we want to keep treating the old tests as tests,
// but the new tests should not make a difference
return false
}
return ( return (
process.env.NODE_ENV === "jest" || process.env.NODE_ENV === "jest" ||
process.env.NODE_ENV === "cypress" || process.env.NODE_ENV === "cypress" ||