diff options
Diffstat (limited to 'packages/db/test/test-utils.js')
-rw-r--r-- | packages/db/test/test-utils.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/db/test/test-utils.js b/packages/db/test/test-utils.js index 3ad5d3c14..bf66cdb1c 100644 --- a/packages/db/test/test-utils.js +++ b/packages/db/test/test-utils.js @@ -64,6 +64,18 @@ export async function setupRemoteDbServer(astroConfig) { }; } +/** + * Clears the environment variables related to Astro DB and Astro Studio. + */ +export function clearEnvironment() { + const keys = Array.from(Object.keys(process.env)); + for (const key of keys) { + if (key.startsWith('ASTRO_DB_') || key.startsWith('ASTRO_STUDIO_')) { + delete process.env[key]; + } + } +} + function createRemoteDbServer() { const dbClient = createClient({ url: ':memory:', |