import { Logger } from "@zowe/imperative"; import { ISetupEnvironmentParms } from "./doc/parms/ISetupEnvironmentParms"; import { ITestEnvironment } from "./doc/response/ITestEnvironment"; /** * Use the utility methods here to setup the test environment for running APIs * and CLIs. Imperative will always touch the filesystem in some capacity * and these utilties help containerize the tests. * @export * @class TestEnvironment */ export declare class TestEnvironment { static readonly ERROR_TAG: string; static readonly HOME_ENV_KEY = "ZOWE_CLI_HOME"; /** * Integration tests (tests that will perform an Imperative init, use the filesystem, etc) should invoke this method * as part of the Jest describes "beforeAll()" method. This method creates a unique test environment to enable * parallel execution of tests and to provide an isolated working directory for any filesystem manipulation that * needs to occur. * @static * @param {ISetupEnvironmentParms} params - See the interface for parameter details. * @returns {Promise} * @memberof TestEnvironment */ static setUp(params: ISetupEnvironmentParms): Promise>; /** * Clean up your test environment. * Deletes any temporary profiles that have been created * @params {ITestEnvironment} testEnvironment - the test environment returned by createTestEnv * * @returns {Promise} - promise fulfilled when cleanup is complete * @throws errors if profiles fail to delete * @memberof TestEnvironment */ static cleanUp(testEnvironment: ITestEnvironment): Promise; /** * Creates a unique test data directory for a test to work with in isolation. * @static * @param {string} testName - Adds the test name to the directory name for ease of identification. * @returns {string} - The unique directory (within the results/data/ area). * @memberof TestEnvironment */ static createUniqueTestDataDir(testName: string): string; protected static readonly DEFAULT_PROPERTIES = "custom_properties.yaml"; protected static readonly DEFAULT_PROPERTIES_LOCATION: string; /** * Load the properties file specified with system test configuration information. * @static * @param {string} filePath - Specify the filePath of the properties file. Leave empty to use the properties * file specified in the process.env. * @param {string} testDirectory - the working directory to log informational messages to * @returns {ITestPropertiesSchema} - The parsed test properties. * @memberof TestEnvironment */ protected static loadSystemTestProperties(_filePath: (string | null) | undefined, testDirectory: string): T; /** * Installs the plug-in into the working directory created for the test environment, * so that commands exposed through this plug-in can be issued in tests. * @param {ITestEnvironment} testEnvironment the test environment so far * @returns {Promise} - promise that resolves on completion of the install */ protected static installPlugin(testEnvironment: ITestEnvironment): Promise; /** * Get a mocked version of the logger interface for logging test environment debug info * @param {string} workingDir - the working directory to log to * @returns {Logger} - a logger that can be used for test environment clean up and set up */ protected static getMockFileLogger(workingDir: string): Logger; } //# sourceMappingURL=TestEnvironment.d.ts.map