Skip to content

Commit

Permalink
feat: fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Maldonado <[email protected]>
  • Loading branch information
md0x committed Jul 16, 2024
1 parent 87bac83 commit b3731f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ function getEnvVar(varName: string, defaultValue?: string): string {
const envValue = process.env[varName];
if (envValue !== undefined) return envValue;
if (defaultValue !== undefined) return defaultValue;
if (typeof global.it === 'function') {
// Not running in a Mocha test
return "";
}
throw new Error(`Environment error: ${varName} not set.`);
}

Expand Down

0 comments on commit b3731f7

Please sign in to comment.