diff options
author | 2024-09-03 09:53:29 -0300 | |
---|---|---|
committer | 2024-09-03 14:53:29 +0200 | |
commit | cc820c5d5e176a8d71594d612af75e1c94b9bf02 (patch) | |
tree | 37818aec97adda9be092590f05c069bc3bd60fa1 /packages/db/test/test-utils.js | |
parent | cd542109ba5b39598da6573f128c6783a6701215 (diff) | |
download | astro-cc820c5d5e176a8d71594d612af75e1c94b9bf02.tar.gz astro-cc820c5d5e176a8d71594d612af75e1c94b9bf02.tar.zst astro-cc820c5d5e176a8d71594d612af75e1c94b9bf02.zip |
Fix mixed DB token env vars (#11894)
* Fix mixed DB token env vars
* Test env combinations
* Fix linter issues
* Fix linter issues
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
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:', |