Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return __awaiter(this, void 0, void 0, function* () {
var loadedConfig = T.ImperativeConfig.instance.loadedConfig;
var testCliConfig = require(__dirname + "/../../../../../../test_cli/TestConfiguration");
if (loadedConfig != null) {
params.response.console.log("Imperative configuration is accessible from the test plugin");
} else {
throw new T.ImperativeError({msg: "Imperative configuration is not accessible from the test plugin"});
}
if (loadedConfig.rootCommandDescription === testCliConfig.rootCommandDescription) {
params.response.console.log("Imperative configuration does contain the expected rootCommandDescription");
} else {
throw new T.ImperativeError({msg: "Imperative configuration does not contain the expected rootCommandDescription"});
}
if (loadedConfig.defaultHome === testCliConfig.defaultHome) {
params.response.console.log("Imperative configuration does contain the expected defaultHome");
return __awaiter(this, void 0, void 0, function* () {
var aLogger = T.Imperative.api.appLogger;
aLogger.debug(`Log message from test plugin: DEBUG: ${params.arguments.test}`);
aLogger.info(`Log message from test plugin: INFO: ${params.arguments.test}`);
aLogger.warn(`Log message from test plugin: WARN: ${params.arguments.test}`);
aLogger.error(`Log message from test plugin: ERROR: ${params.arguments.test}`);
var iLogger = T.Imperative.api.imperativeLogger;
iLogger.debug(`Log message from test plugin: DEBUG: ${params.arguments.test}`);
iLogger.info(`Log message from test plugin: INFO: ${params.arguments.test}`);
iLogger.warn(`Log message from test plugin: WARN: ${params.arguments.test}`);
iLogger.error(`Log message from test plugin: ERROR: ${params.arguments.test}`);
var config = T.ImperativeConfig.instance.loadedConfig;
params.response.console.log(`${params.arguments.test}: Messages logged successfully to the following locations`);
params.response.console.log(path.join(config.defaultHome, "imperative", "logs", "imperative.log"));
params.response.console.log(path.join(config.defaultHome, config.name, "logs", config.name + ".log"));
});
}