Skip to content

Commit

Permalink
restoring clitestutils cleanup()
Browse files Browse the repository at this point in the history
Signed-off-by: ATorrise <[email protected]>
  • Loading branch information
ATorrise committed Aug 29, 2024
1 parent 9d59e1a commit fe2c72b
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,25 @@ export class TestEnvironment {
return ProfileInfo.createSession(zosmfMergedArgs.knownArgs);
}

/**
* Clean up your test environment.
* Deletes any temporary profiles that have been created
* @params {ITestEnvironment} testEnvironment - the test environment returned by createTestEnv
*
* @returns {Promise<void>} - promise fulfilled when cleanup is complete
* @throws errors if profiles fail to delete
* @memberof TestEnvironment
*/
public static async cleanUp(testEnvironment: ITestEnvironment<any>) {
if (testEnvironment.tempProfiles != null) {
await TempTestProfiles.deleteProfiles(testEnvironment);
}
if (testEnvironment.pluginInstalled) {
const pluginDir = testEnvironment.workingDir + "/plugins";
require("rimraf").sync(pluginDir);
}
}

/**
* Creates a unique test data directory for a test to work with in isolation.
* @static
Expand Down

0 comments on commit fe2c72b

Please sign in to comment.