diff --git a/packages/backend-core/src/environment.ts b/packages/backend-core/src/environment.ts index 91556ddcd6..77328eedaf 100644 --- a/packages/backend-core/src/environment.ts +++ b/packages/backend-core/src/environment.ts @@ -1,4 +1,15 @@ +function isDockerisedTest() { + return process.env.DOCKERISED_TEST === "true" +} + 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() } diff --git a/packages/server/src/environment.ts b/packages/server/src/environment.ts index 6272e0e462..d11661ce27 100644 --- a/packages/server/src/environment.ts +++ b/packages/server/src/environment.ts @@ -1,6 +1,17 @@ import { join } from "path" +function isDockerisedTest() { + return process.env.DOCKERISED_TEST === "true" +} + 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() } diff --git a/packages/worker/src/environment.ts b/packages/worker/src/environment.ts index 52fec210bc..aab30883ea 100644 --- a/packages/worker/src/environment.ts +++ b/packages/worker/src/environment.ts @@ -4,7 +4,17 @@ function isDev() { return process.env.NODE_ENV !== "production" } +function isDockerisedTest() { + return process.env.DOCKERISED_TEST === "true" +} + 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 ( process.env.NODE_ENV === "jest" || process.env.NODE_ENV === "cypress" ||