Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public static async setUp(params: ISetupEnvironmentParms): Promise {
// Validate the input parameters
ImperativeExpect.toNotBeNullOrUndefined(params,
`${TestEnvironment.ERROR_TAG} createTestEnv(): No parameters supplied.`);
ImperativeExpect.keysToBeDefinedAndNonBlank(params, ["testName"],
`${TestEnvironment.ERROR_TAG} createTestEnv(): You must supply the name of the test. ` +
`Used to append to the data directory for ease of identification.`);
// Get a unique test data area
const testDirectory: string = TestEnvironment.createUniqueTestDataDir(params.testName);
// set the env variables to be used for executing
// scripts in the test environment
const env: { [key: string]: string } = {};
env[this.HOME_ENV_KEY] = testDirectory;
const result: ITestEnvironment = {
workingDir: testDirectory,
systemTestProperties: null,
env
};