New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aft-core

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aft-core - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

dist/src/construction/options-manager.d.ts

31

dist/src/construction/plugin-manager.d.ts

@@ -1,12 +0,27 @@

import { TestLog } from "../logging/test-log";
import { IPlugin } from "./iplugin";
import { PluginManagerOptions } from "./plugin-manager-options";
export declare abstract class PluginManager<T extends IPlugin> {
protected pluginName: string;
import { OptionsManager } from "./options-manager";
/**
* helper base class for use by classes that load in and manage a plugin
* to provide integration with some external system.
* NOTE: loading of only one plugin is supported by this base class and
* the configuration key for it must always be `pluginName`.
* ex: `aftconfig.json`
* ```
* {
* "someConfigOptions": {
* ...
* "pluginName": "./path/to/plugin"
* ...
* }
* }
* ```
*/
export declare abstract class PluginManager<T extends IPlugin, Tops> extends OptionsManager<Tops> {
protected plugin: T;
protected logger: TestLog;
constructor(options?: PluginManagerOptions);
abstract getConfigurationKey(): string;
getPluginName(): Promise<string>;
/**
* loads the plugin that is specified either in the options passed
* to the class constructor or within `aftconfig.json`. if no plugin
* is specified then nothing will be loaded and `undefined` is returned
*/
getPlugin(): Promise<T>;
}
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -40,47 +53,46 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

exports.PluginManager = void 0;
var test_config_1 = require("../configuration/test-config");
var test_log_1 = require("../logging/test-log");
var options_manager_1 = require("./options-manager");
var plugin_loader_1 = require("./plugin-loader");
var PluginManager = /** @class */ (function () {
function PluginManager(options) {
this.pluginName = options === null || options === void 0 ? void 0 : options.pluginName;
this.plugin = options === null || options === void 0 ? void 0 : options.plugin;
var typeName = Object.getPrototypeOf(this).constructor.name;
this.logger = (options === null || options === void 0 ? void 0 : options.logger) || new test_log_1.TestLog({ name: typeName });
/**
* helper base class for use by classes that load in and manage a plugin
* to provide integration with some external system.
* NOTE: loading of only one plugin is supported by this base class and
* the configuration key for it must always be `pluginName`.
* ex: `aftconfig.json`
* ```
* {
* "someConfigOptions": {
* ...
* "pluginName": "./path/to/plugin"
* ...
* }
* }
* ```
*/
var PluginManager = /** @class */ (function (_super) {
__extends(PluginManager, _super);
function PluginManager() {
return _super !== null && _super.apply(this, arguments) || this;
}
PluginManager.prototype.getPluginName = function () {
/**
* loads the plugin that is specified either in the options passed
* to the class constructor or within `aftconfig.json`. if no plugin
* is specified then nothing will be loaded and `undefined` is returned
*/
PluginManager.prototype.getPlugin = function () {
return __awaiter(this, void 0, void 0, function () {
var _a;
var pName, _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
if (!!this.pluginName) return [3 /*break*/, 2];
_a = this;
return [4 /*yield*/, test_config_1.TestConfig.get(this.getConfigurationKey())];
case 1:
_a.pluginName = _b.sent();
_b.label = 2;
case 2: return [2 /*return*/, this.pluginName];
}
});
});
};
PluginManager.prototype.getPlugin = function () {
return __awaiter(this, void 0, void 0, function () {
var pluginName, plugin;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!!this.plugin) return [3 /*break*/, 3];
return [4 /*yield*/, this.getPluginName()];
return [4 /*yield*/, this.getOption('pluginName')];
case 1:
pluginName = _a.sent();
if (!pluginName) return [3 /*break*/, 3];
return [4 /*yield*/, plugin_loader_1.PluginLoader.load(pluginName)];
pName = _b.sent();
if (!pName) return [3 /*break*/, 3];
_a = this;
return [4 /*yield*/, plugin_loader_1.PluginLoader.load(pName)];
case 2:
plugin = _a.sent();
if (plugin) {
this.plugin = plugin;
}
_a.label = 3;
_a.plugin = _b.sent();
_b.label = 3;
case 3: return [2 /*return*/, this.plugin];

@@ -92,4 +104,4 @@ }

return PluginManager;
}());
}(options_manager_1.OptionsManager));
exports.PluginManager = PluginManager;
//# sourceMappingURL=plugin-manager.js.map
/**
* [OBSOLETE] use `BuildInfoPluginManager.instance()` instead
* [OBSOLETE] use `BuildInfoManager.instance()` instead
*/

@@ -4,0 +4,0 @@ export declare module BuildInfo {

@@ -40,5 +40,5 @@ "use strict";

exports.BuildInfo = void 0;
var build_info_plugin_manager_1 = require("./build-info-plugin-manager");
var build_info_manager_1 = require("./build-info-manager");
/**
* [OBSOLETE] use `BuildInfoPluginManager.instance()` instead
* [OBSOLETE] use `BuildInfoManager.instance()` instead
*/

@@ -56,3 +56,3 @@ var BuildInfo;

switch (_a.label) {
case 0: return [4 /*yield*/, build_info_plugin_manager_1.BuildInfoPluginManager.instance().getBuildName()];
case 0: return [4 /*yield*/, build_info_manager_1.BuildInfoManager.instance().getBuildName()];
case 1: return [2 /*return*/, _a.sent()];

@@ -73,3 +73,3 @@ }

switch (_a.label) {
case 0: return [4 /*yield*/, build_info_plugin_manager_1.BuildInfoPluginManager.instance().getBuildNumber()];
case 0: return [4 /*yield*/, build_info_manager_1.BuildInfoManager.instance().getBuildNumber()];
case 1: return [2 /*return*/, _a.sent()];

@@ -76,0 +76,0 @@ }

@@ -5,3 +5,6 @@ /** configuration */

export * from './construction/constructor';
export * from './construction/iplugin';
export * from './construction/options-manager';
export * from './construction/plugin-loader';
export * from './construction/plugin-manager';
/** extensions */

@@ -12,11 +15,15 @@ export * from './extensions/ellipsis-location';

/** helpers */
export * from './helpers/action';
export * from './helpers/build-info-manager-options';
export * from './helpers/build-info-manager';
export * from './helpers/build-info';
export * from './helpers/build-info-plugin-manager';
export * from './helpers/ibuild-info-handler-plugin';
export * from './helpers/cloner';
export * from './helpers/convert';
export * from './helpers/func';
export * from './helpers/ibuild-info-handler-plugin';
export * from './helpers/icloneable';
export * from './helpers/idisposable';
export * from './helpers/iplugin-manager-options';
export * from './helpers/machine-info';
export * from './helpers/processing-result';
export * from './helpers/machine-info';
export * from './helpers/random-generator';

@@ -26,7 +33,6 @@ export * from './helpers/safe-string-option';

export * from './helpers/wait';
export * from './helpers/func';
export * from './helpers/action';
/** integrations */
export * from './integrations/defects/plugins/idefect-handler-plugin';
export * from './integrations/defects/defect-plugin-manager';
export * from './integrations/defects/defect-manager-options';
export * from './integrations/defects/defect-manager';
export * from './integrations/defects/defect-status';

@@ -36,14 +42,15 @@ export * from './integrations/defects/idefect';

export * from './integrations/test-cases/itest-case';
export * from './integrations/test-cases/test-case-plugin-manager';
export * from './integrations/test-cases/itest-result';
export * from './integrations/test-cases/test-case-manager-options';
export * from './integrations/test-cases/test-case-manager';
export * from './integrations/test-cases/test-exception';
export * from './integrations/test-cases/itest-result';
export * from './integrations/test-cases/test-status';
/** logging */
export * from './logging/plugins/ilogging-plugin';
export * from './logging/logging-level';
export * from './logging/logging-options';
export * from './logging/test-log';
export * from './logging/logging-options';
export * from './logging/logging-level';
/** wrappers */
export * from './wrappers/should';
export * from './wrappers/test-wrapper-options';
export * from './wrappers/test-wrapper';
export * from './wrappers/test-wrapper-options';
export * from './wrappers/should';

@@ -17,3 +17,6 @@ "use strict";

__exportStar(require("./construction/constructor"), exports);
__exportStar(require("./construction/iplugin"), exports);
__exportStar(require("./construction/options-manager"), exports);
__exportStar(require("./construction/plugin-loader"), exports);
__exportStar(require("./construction/plugin-manager"), exports);
/** extensions */

@@ -24,11 +27,15 @@ __exportStar(require("./extensions/ellipsis-location"), exports);

/** helpers */
__exportStar(require("./helpers/action"), exports);
__exportStar(require("./helpers/build-info-manager-options"), exports);
__exportStar(require("./helpers/build-info-manager"), exports);
__exportStar(require("./helpers/build-info"), exports);
__exportStar(require("./helpers/build-info-plugin-manager"), exports);
__exportStar(require("./helpers/ibuild-info-handler-plugin"), exports);
__exportStar(require("./helpers/cloner"), exports);
__exportStar(require("./helpers/convert"), exports);
__exportStar(require("./helpers/func"), exports);
__exportStar(require("./helpers/ibuild-info-handler-plugin"), exports);
__exportStar(require("./helpers/icloneable"), exports);
__exportStar(require("./helpers/idisposable"), exports);
__exportStar(require("./helpers/iplugin-manager-options"), exports);
__exportStar(require("./helpers/machine-info"), exports);
__exportStar(require("./helpers/processing-result"), exports);
__exportStar(require("./helpers/machine-info"), exports);
__exportStar(require("./helpers/random-generator"), exports);

@@ -38,7 +45,6 @@ __exportStar(require("./helpers/safe-string-option"), exports);

__exportStar(require("./helpers/wait"), exports);
__exportStar(require("./helpers/func"), exports);
__exportStar(require("./helpers/action"), exports);
/** integrations */
__exportStar(require("./integrations/defects/plugins/idefect-handler-plugin"), exports);
__exportStar(require("./integrations/defects/defect-plugin-manager"), exports);
__exportStar(require("./integrations/defects/defect-manager-options"), exports);
__exportStar(require("./integrations/defects/defect-manager"), exports);
__exportStar(require("./integrations/defects/defect-status"), exports);

@@ -48,15 +54,16 @@ __exportStar(require("./integrations/defects/idefect"), exports);

__exportStar(require("./integrations/test-cases/itest-case"), exports);
__exportStar(require("./integrations/test-cases/test-case-plugin-manager"), exports);
__exportStar(require("./integrations/test-cases/itest-result"), exports);
__exportStar(require("./integrations/test-cases/test-case-manager-options"), exports);
__exportStar(require("./integrations/test-cases/test-case-manager"), exports);
__exportStar(require("./integrations/test-cases/test-exception"), exports);
__exportStar(require("./integrations/test-cases/itest-result"), exports);
__exportStar(require("./integrations/test-cases/test-status"), exports);
/** logging */
__exportStar(require("./logging/plugins/ilogging-plugin"), exports);
__exportStar(require("./logging/logging-level"), exports);
__exportStar(require("./logging/logging-options"), exports);
__exportStar(require("./logging/test-log"), exports);
__exportStar(require("./logging/logging-options"), exports);
__exportStar(require("./logging/logging-level"), exports);
/** wrappers */
__exportStar(require("./wrappers/should"), exports);
__exportStar(require("./wrappers/test-wrapper-options"), exports);
__exportStar(require("./wrappers/test-wrapper"), exports);
__exportStar(require("./wrappers/test-wrapper-options"), exports);
__exportStar(require("./wrappers/should"), exports);
//# sourceMappingURL=index.js.map

@@ -5,13 +5,33 @@ import { ITestResult } from "../integrations/test-cases/itest-result";

import { LoggingOptions } from "./logging-options";
export declare class TestLog {
import { OptionsManager } from "../construction/options-manager";
/**
* a logging class that uses configuration to determine what
* should be logged to the console and formats the logging output
* to indicate the source of the logging data. Additionally this
* class manages logging plugins and serves as the interface for
* sending `ITestResult` data to `ILoggingPlugin` instances.
* Configuration for this class can be passed in directly or
* specified in `aftconfig.json` like:
* ```
* {
* ...
* "logging": {
* "level": "info",
* "pluginNames": [
* "./relative/path/to/logging-plugin1",
* "/full/path/to/logging-plugin2"
* ]
* }
* ...
* }
* ```
*/
export declare class TestLog extends OptionsManager<LoggingOptions> {
private _name;
private _stepCount;
private _options;
private _level;
private _plugins;
constructor(options?: LoggingOptions);
name(): string;
getOptionsConfigurationKey(): string;
name(): Promise<string>;
stepCount(): number;
initName(name: string): void;
options(): Promise<LoggingOptions>;
level(): Promise<LoggingLevel>;

@@ -18,0 +38,0 @@ plugins(): Promise<ILoggingPlugin[]>;

"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -42,3 +55,2 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

var plugin_loader_1 = require("../construction/plugin-loader");
var test_config_1 = require("../configuration/test-config");
var convert_1 = require("../helpers/convert");

@@ -48,31 +60,48 @@ var cloner_1 = require("../helpers/cloner");

var ellipsis_location_1 = require("../extensions/ellipsis-location");
var TestLog = /** @class */ (function () {
function TestLog(options) {
var _a;
this._stepCount = 0;
this._options = options;
this.initName(((_a = this._options) === null || _a === void 0 ? void 0 : _a.name) || "TestLog_" + random_generator_1.RG.getGuid());
var options_manager_1 = require("../construction/options-manager");
/**
* a logging class that uses configuration to determine what
* should be logged to the console and formats the logging output
* to indicate the source of the logging data. Additionally this
* class manages logging plugins and serves as the interface for
* sending `ITestResult` data to `ILoggingPlugin` instances.
* Configuration for this class can be passed in directly or
* specified in `aftconfig.json` like:
* ```
* {
* ...
* "logging": {
* "level": "info",
* "pluginNames": [
* "./relative/path/to/logging-plugin1",
* "/full/path/to/logging-plugin2"
* ]
* }
* ...
* }
* ```
*/
var TestLog = /** @class */ (function (_super) {
__extends(TestLog, _super);
function TestLog() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._stepCount = 0;
return _this;
}
TestLog.prototype.getOptionsConfigurationKey = function () {
return 'logging';
};
TestLog.prototype.name = function () {
return this._name;
};
TestLog.prototype.stepCount = function () {
return this._stepCount;
};
TestLog.prototype.initName = function (name) {
this._name = convert_1.Convert.toSafeString(name).ellide(50, ellipsis_location_1.EllipsisLocation.middle);
};
TestLog.prototype.options = function () {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(this, function (_b) {
switch (_b.label) {
var n;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!!this._options) return [3 /*break*/, 2];
_a = this;
return [4 /*yield*/, test_config_1.TestConfig.get("logging")];
if (!!this._name) return [3 /*break*/, 2];
return [4 /*yield*/, this.getOption('name', "TestLog_" + random_generator_1.RG.getGuid())];
case 1:
_a._options = _b.sent();
_b.label = 2;
case 2: return [2 /*return*/, this._options];
n = _a.sent();
this._name = convert_1.Convert.toSafeString(n).ellide(50, ellipsis_location_1.EllipsisLocation.middle);
_a.label = 2;
case 2: return [2 /*return*/, this._name];
}

@@ -82,16 +111,18 @@ });

};
TestLog.prototype.stepCount = function () {
return this._stepCount;
};
TestLog.prototype.level = function () {
var _a;
return __awaiter(this, void 0, void 0, function () {
var _b, _c, _d;
return __generator(this, function (_e) {
switch (_e.label) {
var _a, _b, _c;
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
if (!!this._level) return [3 /*break*/, 2];
_b = this;
_d = (_c = logging_level_1.LoggingLevel).parse;
return [4 /*yield*/, this.options()];
_a = this;
_c = (_b = logging_level_1.LoggingLevel).parse;
return [4 /*yield*/, this.getOption('level', logging_level_1.LoggingLevel.info.name)];
case 1:
_b._level = _d.apply(_c, [((_a = (_e.sent())) === null || _a === void 0 ? void 0 : _a.level) || logging_level_1.LoggingLevel.info.name]);
_e.label = 2;
_a._level = _c.apply(_b, [(_d.sent())]);
_d.label = 2;
case 2: return [2 /*return*/, this._level];

@@ -103,15 +134,14 @@ }

TestLog.prototype.plugins = function () {
var _a;
return __awaiter(this, void 0, void 0, function () {
var names, i, name_1, p;
return __generator(this, function (_b) {
switch (_b.label) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!!this._plugins) return [3 /*break*/, 5];
this._plugins = [];
return [4 /*yield*/, this.options()];
return [4 /*yield*/, this.getOption('pluginNames', [])];
case 1:
names = ((_a = (_b.sent())) === null || _a === void 0 ? void 0 : _a.pluginNames) || [];
names = _a.sent();
i = 0;
_b.label = 2;
_a.label = 2;
case 2:

@@ -123,7 +153,7 @@ if (!(i < names.length)) return [3 /*break*/, 5];

case 3:
p = _b.sent();
p = _a.sent();
if (p) {
this._plugins.push(p);
}
_b.label = 4;
_a.label = 4;
case 4:

@@ -274,40 +304,48 @@ i++;

return __awaiter(this, void 0, void 0, function () {
var l, plugins, i, p, enabled, e_1;
return __generator(this, function (_a) {
switch (_a.label) {
var l, _a, _b, _c, _d, plugins, i, p, enabled, e_1, _e, _f, _g, _h;
return __generator(this, function (_j) {
switch (_j.label) {
case 0: return [4 /*yield*/, this.level()];
case 1:
l = _a.sent();
if (level.value >= l.value && level != logging_level_1.LoggingLevel.none) {
console.log(TestLog.format(this.name(), level, message));
}
return [4 /*yield*/, this.plugins()];
l = _j.sent();
if (!(level.value >= l.value && level != logging_level_1.LoggingLevel.none)) return [3 /*break*/, 3];
_b = (_a = console).log;
_d = (_c = TestLog).format;
return [4 /*yield*/, this.name()];
case 2:
plugins = _a.sent();
_b.apply(_a, [_d.apply(_c, [_j.sent(), level, message])]);
_j.label = 3;
case 3: return [4 /*yield*/, this.plugins()];
case 4:
plugins = _j.sent();
i = 0;
_a.label = 3;
case 3:
if (!(i < plugins.length)) return [3 /*break*/, 10];
_j.label = 5;
case 5:
if (!(i < plugins.length)) return [3 /*break*/, 13];
p = plugins[i];
if (!p) return [3 /*break*/, 9];
_a.label = 4;
case 4:
_a.trys.push([4, 8, , 9]);
if (!p) return [3 /*break*/, 12];
_j.label = 6;
case 6:
_j.trys.push([6, 10, , 12]);
return [4 /*yield*/, p.isEnabled()];
case 5:
enabled = _a.sent();
if (!enabled) return [3 /*break*/, 7];
case 7:
enabled = _j.sent();
if (!enabled) return [3 /*break*/, 9];
return [4 /*yield*/, p.log(level, message)];
case 6:
_a.sent();
_a.label = 7;
case 7: return [3 /*break*/, 9];
case 8:
e_1 = _a.sent();
console.warn(TestLog.format(this.name(), logging_level_1.LoggingLevel.warn, "unable to send log message to '" + (p.name || 'unknown') + "' plugin due to: " + e_1));
return [3 /*break*/, 9];
case 9:
_j.sent();
_j.label = 9;
case 9: return [3 /*break*/, 12];
case 10:
e_1 = _j.sent();
_f = (_e = console).warn;
_h = (_g = TestLog).format;
return [4 /*yield*/, this.name()];
case 11:
_f.apply(_e, [_h.apply(_g, [_j.sent(), logging_level_1.LoggingLevel.warn, "unable to send log message to '" + (p.name || 'unknown') + "' plugin due to: " + e_1])]);
return [3 /*break*/, 12];
case 12:
i++;
return [3 /*break*/, 3];
case 10: return [2 /*return*/];
return [3 /*break*/, 5];
case 13: return [2 /*return*/];
}

@@ -368,33 +406,37 @@ });

return __awaiter(this, void 0, void 0, function () {
var plugins, i, p, enabled, e_3;
return __generator(this, function (_a) {
switch (_a.label) {
var plugins, i, p, enabled, e_3, _a, _b, _c, _d;
return __generator(this, function (_e) {
switch (_e.label) {
case 0: return [4 /*yield*/, this.plugins()];
case 1:
plugins = _a.sent();
plugins = _e.sent();
i = 0;
_a.label = 2;
_e.label = 2;
case 2:
if (!(i < plugins.length)) return [3 /*break*/, 9];
if (!(i < plugins.length)) return [3 /*break*/, 10];
p = plugins[i];
_a.label = 3;
_e.label = 3;
case 3:
_a.trys.push([3, 7, , 8]);
_e.trys.push([3, 7, , 9]);
return [4 /*yield*/, p.isEnabled()];
case 4:
enabled = _a.sent();
enabled = _e.sent();
if (!enabled) return [3 /*break*/, 6];
return [4 /*yield*/, plugins[i].finalise()];
case 5:
_a.sent();
_a.label = 6;
case 6: return [3 /*break*/, 8];
_e.sent();
_e.label = 6;
case 6: return [3 /*break*/, 9];
case 7:
e_3 = _a.sent();
console.log(TestLog.format(this.name(), logging_level_1.LoggingLevel.warn, "unable to call finalise on " + p.name + " due to: " + e_3));
return [3 /*break*/, 8];
e_3 = _e.sent();
_b = (_a = console).log;
_d = (_c = TestLog).format;
return [4 /*yield*/, this.name()];
case 8:
_b.apply(_a, [_d.apply(_c, [_e.sent(), logging_level_1.LoggingLevel.warn, "unable to call finalise on " + p.name + " due to: " + e_3])]);
return [3 /*break*/, 9];
case 9:
i++;
return [3 /*break*/, 2];
case 9: return [2 /*return*/];
case 10: return [2 /*return*/];
}

@@ -405,3 +447,3 @@ });

return TestLog;
}());
}(options_manager_1.OptionsManager));
exports.TestLog = TestLog;

@@ -408,0 +450,0 @@ (function (TestLog) {

@@ -1,13 +0,13 @@

import { BuildInfoPluginManager } from "../helpers/build-info-plugin-manager";
import { DefectPluginManager } from "../integrations/defects/defect-plugin-manager";
import { TestCasePluginManager } from "../integrations/test-cases/test-case-plugin-manager";
import { BuildInfoManager } from "../helpers/build-info-manager";
import { DefectManager } from "../integrations/defects/defect-manager";
import { TestCaseManager } from "../integrations/test-cases/test-case-manager";
import { TestLog } from "../logging/test-log";
export interface TestWrapperOptions {
buildInfoPluginManager?: BuildInfoPluginManager;
buildInfoManager?: BuildInfoManager;
defects?: string[];
defectPluginManager?: DefectPluginManager;
defectManager?: DefectManager;
logger?: TestLog;
testCases?: string[];
testCasePluginManager?: TestCasePluginManager;
testCaseManager?: TestCaseManager;
description?: string;
}

@@ -64,7 +64,7 @@ "use strict";

var convert_1 = require("../helpers/convert");
var test_case_plugin_manager_1 = require("../integrations/test-cases/test-case-plugin-manager");
var defect_plugin_manager_1 = require("../integrations/defects/defect-plugin-manager");
var test_case_manager_1 = require("../integrations/test-cases/test-case-manager");
var defect_manager_1 = require("../integrations/defects/defect-manager");
var defect_status_1 = require("../integrations/defects/defect-status");
var random_generator_1 = require("../helpers/random-generator");
var build_info_plugin_manager_1 = require("../helpers/build-info-plugin-manager");
var build_info_manager_1 = require("../helpers/build-info-manager");
/**

@@ -173,3 +173,3 @@ * provides pre-test execution filtering based on specified

var _a;
this._testCaseManager = (options === null || options === void 0 ? void 0 : options.testCasePluginManager) || test_case_plugin_manager_1.TestCasePluginManager.instance();
this._testCaseManager = (options === null || options === void 0 ? void 0 : options.testCaseManager) || test_case_manager_1.TestCaseManager.instance();
(_a = options === null || options === void 0 ? void 0 : options.testCases) === null || _a === void 0 ? void 0 : _a.forEach(function (c) {

@@ -182,3 +182,3 @@ _this.testCases().push(c);

var _a;
this._defectManager = (options === null || options === void 0 ? void 0 : options.defectPluginManager) || defect_plugin_manager_1.DefectPluginManager.instance();
this._defectManager = (options === null || options === void 0 ? void 0 : options.defectManager) || defect_manager_1.DefectManager.instance();
(_a = options === null || options === void 0 ? void 0 : options.defects) === null || _a === void 0 ? void 0 : _a.forEach(function (d) {

@@ -189,3 +189,3 @@ _this.defects().push(d);

TestWrapper.prototype._initialiseBuildInfo = function (options) {
this._buildInfoManager = (options === null || options === void 0 ? void 0 : options.buildInfoPluginManager) || build_info_plugin_manager_1.BuildInfoPluginManager.instance();
this._buildInfoManager = (options === null || options === void 0 ? void 0 : options.buildInfoManager) || build_info_manager_1.BuildInfoManager.instance();
};

@@ -192,0 +192,0 @@ /**

{
"name": "aft-core",
"version": "3.0.0",
"version": "3.1.0",
"description": "Automation Framework for Testing (AFT) package supporting JavaScript unit, integration and functional testing",

@@ -5,0 +5,0 @@ "repository": {

@@ -68,3 +68,3 @@ # AFT-Core

"logging": {
"plugins": [
"pluginNames": [
"./relative/path/to/logging-plugin1",

@@ -84,21 +84,19 @@ "/full/path/to/logging-plugin2"

name: string = 'externallogger';
async level(): Promise<TestLogLevel> {
let levelStr: string = await TestConfig.getValueOrDefault('external-logging-level', TestLogLevel.warn.name);
let levelStr: string = await TestConfig.get('externalLogging.level', TestLogLevel.warn.name);
return TestLogLevel.parse(levelStr);
}
async enabled(): Promise<boolean> {
let enabledStr: string = await TestConfig.getValueOrDefault('external-logging-enabled', 'false');
async isEnabled(): Promise<boolean> {
let enabledStr: string = await TestConfig.get('externalLogging.enabled', 'false');
return enabledStr.toLocaleLowerCase() == 'true';
}
async onLoad(): Promise<void> {
/* do something once on load */
}
async log(level: TestLogLevel, message: string): Promise<void> {
/* perform some external logging action */
}
async logResult(result: TestResult): Promise<void> {
/* log the TestResult to an external system */
}
async finalise(): Promise<void> {

@@ -130,5 +128,8 @@ /* perform any cleanup */

}
async enabled(): Promise<boolean> {
async isEnabled(): Promise<boolean> {
return true;
}
async onLoad(): Promise<void> {
/* do something one time on load */
}
async getTestCase(testId: string): Promise<ITestCase> {

@@ -170,5 +171,8 @@ return await testRailApi.getCaseById(testId);

}
async enabled(): Promise<boolean> {
async isEnabled(): Promise<boolean> {
return true;
}
async onLoad(): Promise<void> {
/* do something one time on load */
}
async getDefect(defectId: string): Promise<IDefect> {

@@ -175,0 +179,0 @@ return await bugzillaApi.getDefectById(defectId);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc