Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/gitpod-protocol/src/util/skip-if.ts
2500 views
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 and prints its
9
* @param name The name of the env var the TestSuite depends on being present
10
*/
11
export function ifEnvVarNotSet(name: string): boolean {
12
const skip = process.env[name] === undefined;
13
if (skip) {
14
console.log(`Skipping suite because env var '${name}' is not set`);
15
}
16
return skip;
17
}
18
19