1/** 2 * Copyright (c) 2020 Gitpod GmbH. All rights reserved. 3 * Licensed under the GNU Affero General Public License (AGPL). 4 * See License.AGPL.txt in the project root for license information. 5 */ 6 7/** 8 * Skips a Mocha TestSuite if a certain env var is not set or empty 9 * @param name The name of the env var the TestSuite depends on being present 10 */ 11export function ifEnvVarNotSet(name: string): boolean { 12 const value = process.env[name]; 13 const skip = value === undefined || value === ""; 14 if (skip) { 15 console.log(`Skipping suite because env var '${name}' is not set or empty`); 16 } 17 return skip; 18} 19 20