qase-javascript-commons 2.4.5 → 2.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -4
- package/changelog.md +12 -0
- package/dist/client/dateUtils.js +2 -3
- package/dist/config/config-validation-schema.d.ts +14 -0
- package/dist/config/config-validation-schema.js +14 -0
- package/dist/env/env-enum.d.ts +7 -0
- package/dist/env/env-enum.js +9 -1
- package/dist/env/env-to-config.js +4 -0
- package/dist/env/env-type.d.ts +3 -1
- package/dist/env/env-validation-schema.js +8 -0
- package/dist/models/attachment.d.ts +0 -1
- package/dist/options/composeOptions.d.ts +0 -1
- package/dist/options/options-type.d.ts +5 -0
- package/dist/qase.js +11 -1
- package/dist/utils/hostData.js +18 -9
- package/dist/utils/is-axios-error.d.ts +1 -1
- package/dist/utils/logger.d.ts +4 -0
- package/dist/utils/logger.js +38 -14
- package/dist/utils/mimeTypes.js +18 -9
- package/dist/utils/status-mapping-utils.js +2 -3
- package/dist/utils/test-status-utils.js +4 -3
- package/dist/utils/validate-json.js +2 -2
- package/dist/writer/fs-writer.js +17 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,8 +26,9 @@ npm install qase-javascript-commons
|
|
|
26
26
|
|
|
27
27
|
Qase JS Reporters can be configured in multiple ways:
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
* using a config file `qase.config.json`
|
|
30
|
+
* using environment variables
|
|
31
|
+
|
|
31
32
|
|
|
32
33
|
All configuration options are listed in the table below:
|
|
33
34
|
|
|
@@ -41,6 +42,9 @@ All configuration options are listed in the table below:
|
|
|
41
42
|
| Enable debug logs | `debug` | `QASE_DEBUG` | `False` | No | `True`, `False` |
|
|
42
43
|
| Enable capture logs from `stdout` and `stderr` | `testops.defect` | `QASE_CAPTURE_LOGS` | `False` | No | `True`, `False` |
|
|
43
44
|
| Map test result statuses to different values (format: `fromStatus=toStatus`) | `statusMapping` | `QASE_STATUS_MAPPING` | undefined | No | Object mapping statuses (e.g., `{"invalid": "failed", "skipped": "passed"}`) |
|
|
45
|
+
| **Logging configuration** | | | | | |
|
|
46
|
+
| Enable/disable console output for reporter logs | `logging.console` | `QASE_LOGGING_CONSOLE` | `True` | No | `True`, `False` |
|
|
47
|
+
| Enable/disable file output for reporter logs | `logging.file` | `QASE_LOGGING_FILE` | Same as `debug` setting | No | `True`, `False` |
|
|
44
48
|
| **Qase Report configuration** | | | | | |
|
|
45
49
|
| Driver used for report mode | `report.driver` | `QASE_REPORT_DRIVER` | `local` | No | `local` |
|
|
46
50
|
| Path to save the report | `report.connection.path` | `QASE_REPORT_CONNECTION_PATH` | `./build/qase-report` | | |
|
|
@@ -64,7 +68,7 @@ All configuration options are listed in the table below:
|
|
|
64
68
|
| Configuration values to create/find in groups (format: `group1=value1,group2=value2`) | `testops.configurations.values` | `QASE_TESTOPS_CONFIGURATIONS_VALUES` | undefined | No | Comma-separated key=value pairs |
|
|
65
69
|
| Create configuration groups if they don't exist | `testops.configurations.createIfNotExists` | `QASE_TESTOPS_CONFIGURATIONS_CREATE_IF_NOT_EXISTS` | `false` | No | `True`, `False` |
|
|
66
70
|
|
|
67
|
-
### Example `qase.config.json` config
|
|
71
|
+
### Example `qase.config.json` config
|
|
68
72
|
|
|
69
73
|
```json
|
|
70
74
|
{
|
|
@@ -77,6 +81,10 @@ All configuration options are listed in the table below:
|
|
|
77
81
|
"invalid": "failed",
|
|
78
82
|
"skipped": "passed"
|
|
79
83
|
},
|
|
84
|
+
"logging": {
|
|
85
|
+
"console": true,
|
|
86
|
+
"file": true
|
|
87
|
+
},
|
|
80
88
|
"report": {
|
|
81
89
|
"driver": "local",
|
|
82
90
|
"connection": {
|
|
@@ -125,7 +133,7 @@ All configuration options are listed in the table below:
|
|
|
125
133
|
}
|
|
126
134
|
```
|
|
127
135
|
|
|
128
|
-
### Environment Variables Example
|
|
136
|
+
### Environment Variables Example
|
|
129
137
|
|
|
130
138
|
```bash
|
|
131
139
|
# Set external link for Jira Cloud
|
|
@@ -139,4 +147,8 @@ export QASE_TESTOPS_STATUS_FILTER="passed,failed"
|
|
|
139
147
|
|
|
140
148
|
# Map test result statuses
|
|
141
149
|
export QASE_STATUS_MAPPING="invalid=failed,skipped=passed"
|
|
150
|
+
|
|
151
|
+
# Logging configuration
|
|
152
|
+
export QASE_LOGGING_CONSOLE=false # Disable console output
|
|
153
|
+
export QASE_LOGGING_FILE=true # Enable file output
|
|
142
154
|
```
|
package/changelog.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# qase-javascript-commons@2.4.7
|
|
2
|
+
|
|
3
|
+
## Bug fixes
|
|
4
|
+
|
|
5
|
+
Fixed issue where test results with unknown statuses were incorrectly marked as `skipped` instead of `passed` by default. Now status matching is case-insensitive for better compatibility with different test frameworks.
|
|
6
|
+
|
|
7
|
+
# qase-javascript-commons@2.4.6
|
|
8
|
+
|
|
9
|
+
## What's new
|
|
10
|
+
|
|
11
|
+
Added ability to control logging to console and file using the `logging` configuration option.
|
|
12
|
+
|
|
1
13
|
# qase-javascript-commons@2.4.5
|
|
2
14
|
|
|
3
15
|
## What's new
|
package/dist/client/dateUtils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.formatUTCDate = formatUTCDate;
|
|
4
|
+
exports.getStartTime = getStartTime;
|
|
4
5
|
// Utils
|
|
5
6
|
const pad = (num) => num.toString().padStart(2, '0');
|
|
6
7
|
function formatUTCDate(date) {
|
|
@@ -12,9 +13,7 @@ function formatUTCDate(date) {
|
|
|
12
13
|
const seconds = pad(date.getUTCSeconds());
|
|
13
14
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
14
15
|
}
|
|
15
|
-
exports.formatUTCDate = formatUTCDate;
|
|
16
16
|
function getStartTime() {
|
|
17
17
|
const date = new Date();
|
|
18
18
|
return formatUTCDate(new Date(date.getTime() - 10000));
|
|
19
19
|
}
|
|
20
|
-
exports.getStartTime = getStartTime;
|
|
@@ -40,6 +40,20 @@ export declare const configValidationSchema: {
|
|
|
40
40
|
type: string;
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
|
+
logging: {
|
|
44
|
+
type: string;
|
|
45
|
+
nullable: boolean;
|
|
46
|
+
properties: {
|
|
47
|
+
console: {
|
|
48
|
+
type: string;
|
|
49
|
+
nullable: boolean;
|
|
50
|
+
};
|
|
51
|
+
file: {
|
|
52
|
+
type: string;
|
|
53
|
+
nullable: boolean;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
43
57
|
testops: {
|
|
44
58
|
type: string;
|
|
45
59
|
nullable: boolean;
|
|
@@ -43,6 +43,20 @@ exports.configValidationSchema = {
|
|
|
43
43
|
type: 'string',
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
|
+
logging: {
|
|
47
|
+
type: 'object',
|
|
48
|
+
nullable: true,
|
|
49
|
+
properties: {
|
|
50
|
+
console: {
|
|
51
|
+
type: 'boolean',
|
|
52
|
+
nullable: true,
|
|
53
|
+
},
|
|
54
|
+
file: {
|
|
55
|
+
type: 'boolean',
|
|
56
|
+
nullable: true,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
46
60
|
testops: {
|
|
47
61
|
type: 'object',
|
|
48
62
|
nullable: true,
|
package/dist/env/env-enum.d.ts
CHANGED
|
@@ -63,3 +63,10 @@ export declare enum EnvLocalEnum {
|
|
|
63
63
|
path = "QASE_REPORT_CONNECTION_PATH",
|
|
64
64
|
format = "QASE_REPORT_CONNECTION_FORMAT"
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* @enum {string}
|
|
68
|
+
*/
|
|
69
|
+
export declare enum EnvLoggingEnum {
|
|
70
|
+
console = "QASE_LOGGING_CONSOLE",
|
|
71
|
+
file = "QASE_LOGGING_FILE"
|
|
72
|
+
}
|
package/dist/env/env-enum.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EnvLocalEnum = exports.EnvConfigurationsEnum = exports.EnvBatchEnum = exports.EnvPlanEnum = exports.EnvRunEnum = exports.EnvApiEnum = exports.EnvTestOpsEnum = exports.EnvEnum = void 0;
|
|
3
|
+
exports.EnvLoggingEnum = exports.EnvLocalEnum = exports.EnvConfigurationsEnum = exports.EnvBatchEnum = exports.EnvPlanEnum = exports.EnvRunEnum = exports.EnvApiEnum = exports.EnvTestOpsEnum = exports.EnvEnum = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* @enum {string}
|
|
6
6
|
*/
|
|
@@ -74,3 +74,11 @@ var EnvLocalEnum;
|
|
|
74
74
|
EnvLocalEnum["path"] = "QASE_REPORT_CONNECTION_PATH";
|
|
75
75
|
EnvLocalEnum["format"] = "QASE_REPORT_CONNECTION_FORMAT";
|
|
76
76
|
})(EnvLocalEnum || (exports.EnvLocalEnum = EnvLocalEnum = {}));
|
|
77
|
+
/**
|
|
78
|
+
* @enum {string}
|
|
79
|
+
*/
|
|
80
|
+
var EnvLoggingEnum;
|
|
81
|
+
(function (EnvLoggingEnum) {
|
|
82
|
+
EnvLoggingEnum["console"] = "QASE_LOGGING_CONSOLE";
|
|
83
|
+
EnvLoggingEnum["file"] = "QASE_LOGGING_FILE";
|
|
84
|
+
})(EnvLoggingEnum || (exports.EnvLoggingEnum = EnvLoggingEnum = {}));
|
|
@@ -75,5 +75,9 @@ const envToConfig = (env) => ({
|
|
|
75
75
|
},
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
|
+
logging: (env[env_enum_1.EnvLoggingEnum.console] !== undefined || env[env_enum_1.EnvLoggingEnum.file] !== undefined) ? {
|
|
79
|
+
console: env[env_enum_1.EnvLoggingEnum.console],
|
|
80
|
+
file: env[env_enum_1.EnvLoggingEnum.file],
|
|
81
|
+
} : undefined,
|
|
78
82
|
});
|
|
79
83
|
exports.envToConfig = envToConfig;
|
package/dist/env/env-type.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnvEnum, EnvTestOpsEnum, EnvApiEnum, EnvRunEnum, EnvLocalEnum, EnvPlanEnum, EnvBatchEnum, EnvConfigurationsEnum } from './env-enum';
|
|
1
|
+
import { EnvEnum, EnvTestOpsEnum, EnvApiEnum, EnvRunEnum, EnvLocalEnum, EnvPlanEnum, EnvBatchEnum, EnvConfigurationsEnum, EnvLoggingEnum } from './env-enum';
|
|
2
2
|
import { ModeEnum } from '../options';
|
|
3
3
|
import { FormatEnum } from '../writer';
|
|
4
4
|
export interface EnvType {
|
|
@@ -27,4 +27,6 @@ export interface EnvType {
|
|
|
27
27
|
[EnvConfigurationsEnum.createIfNotExists]?: boolean;
|
|
28
28
|
[EnvLocalEnum.path]?: string;
|
|
29
29
|
[EnvLocalEnum.format]?: `${FormatEnum}`;
|
|
30
|
+
[EnvLoggingEnum.console]?: boolean;
|
|
31
|
+
[EnvLoggingEnum.file]?: boolean;
|
|
30
32
|
}
|
|
@@ -113,5 +113,13 @@ exports.envValidationSchema = {
|
|
|
113
113
|
enum: [writer_1.FormatEnum.json, writer_1.FormatEnum.jsonp],
|
|
114
114
|
nullable: true,
|
|
115
115
|
},
|
|
116
|
+
[env_enum_1.EnvLoggingEnum.console]: {
|
|
117
|
+
type: 'boolean',
|
|
118
|
+
nullable: true,
|
|
119
|
+
},
|
|
120
|
+
[env_enum_1.EnvLoggingEnum.file]: {
|
|
121
|
+
type: 'boolean',
|
|
122
|
+
nullable: true,
|
|
123
|
+
},
|
|
116
124
|
},
|
|
117
125
|
};
|
|
@@ -11,6 +11,10 @@ export type AdditionalReportOptionsType = {
|
|
|
11
11
|
driver?: `${DriverEnum}`;
|
|
12
12
|
connections?: ConnectionsType;
|
|
13
13
|
};
|
|
14
|
+
export type LoggingOptionsType = {
|
|
15
|
+
console?: boolean | undefined;
|
|
16
|
+
file?: boolean | undefined;
|
|
17
|
+
};
|
|
14
18
|
export type OptionsType = {
|
|
15
19
|
frameworkPackage: string;
|
|
16
20
|
frameworkName: string;
|
|
@@ -22,6 +26,7 @@ export type OptionsType = {
|
|
|
22
26
|
environment?: string | undefined;
|
|
23
27
|
rootSuite?: string | undefined;
|
|
24
28
|
statusMapping?: Record<string, string> | undefined;
|
|
29
|
+
logging?: RecursivePartial<LoggingOptionsType> | undefined;
|
|
25
30
|
testops?: RecursivePartial<TestOpsOptionsType> | undefined;
|
|
26
31
|
report?: RecursivePartial<AdditionalReportOptionsType> | undefined;
|
|
27
32
|
};
|
package/dist/qase.js
CHANGED
|
@@ -82,7 +82,17 @@ class QaseReporter {
|
|
|
82
82
|
const env = (0, env_1.envToConfig)((0, env_schema_1.default)({ schema: env_1.envValidationSchema }));
|
|
83
83
|
const composedOptions = (0, options_1.composeOptions)(options, env);
|
|
84
84
|
this.options = composedOptions;
|
|
85
|
-
|
|
85
|
+
// Process logging options with backward compatibility
|
|
86
|
+
const loggerOptions = {
|
|
87
|
+
debug: composedOptions.debug,
|
|
88
|
+
};
|
|
89
|
+
if (composedOptions.logging?.console !== undefined) {
|
|
90
|
+
loggerOptions.consoleLogging = composedOptions.logging.console;
|
|
91
|
+
}
|
|
92
|
+
if (composedOptions.logging?.file !== undefined) {
|
|
93
|
+
loggerOptions.fileLogging = composedOptions.logging.file;
|
|
94
|
+
}
|
|
95
|
+
this.logger = new logger_1.Logger(loggerOptions);
|
|
86
96
|
this.logger.logDebug(`Config: ${JSON.stringify(this.sanitizeOptions(composedOptions))}`);
|
|
87
97
|
const hostData = (0, hostData_1.getHostInfo)(options.frameworkPackage, options.reporterName);
|
|
88
98
|
this.logger.logDebug(`Host data: ${JSON.stringify(hostData)}`);
|
package/dist/utils/hostData.js
CHANGED
|
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getHostInfo =
|
|
36
|
+
exports.getHostInfo = getHostInfo;
|
|
27
37
|
const os = __importStar(require("os"));
|
|
28
38
|
const cp = __importStar(require("child_process"));
|
|
29
39
|
const fs = __importStar(require("fs"));
|
|
@@ -188,4 +198,3 @@ function getHostInfo(framework, reporterName) {
|
|
|
188
198
|
};
|
|
189
199
|
}
|
|
190
200
|
}
|
|
191
|
-
exports.getHostInfo = getHostInfo;
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -6,9 +6,13 @@ export interface LoggerInterface {
|
|
|
6
6
|
export declare class Logger implements LoggerInterface {
|
|
7
7
|
private readonly debug;
|
|
8
8
|
private readonly filePath;
|
|
9
|
+
private readonly consoleEnabled;
|
|
10
|
+
private readonly fileEnabled;
|
|
9
11
|
constructor(options: {
|
|
10
12
|
debug?: boolean | undefined;
|
|
11
13
|
dir?: string;
|
|
14
|
+
consoleLogging?: boolean | undefined;
|
|
15
|
+
fileLogging?: boolean | undefined;
|
|
12
16
|
});
|
|
13
17
|
log(message: string): void;
|
|
14
18
|
logError(message: string, error?: unknown): void;
|
package/dist/utils/logger.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.Logger = void 0;
|
|
27
37
|
const fs = __importStar(require("fs"));
|
|
@@ -31,33 +41,47 @@ const qase_error_1 = require("./qase-error");
|
|
|
31
41
|
class Logger {
|
|
32
42
|
debug;
|
|
33
43
|
filePath;
|
|
44
|
+
consoleEnabled;
|
|
45
|
+
fileEnabled;
|
|
34
46
|
constructor(options) {
|
|
35
47
|
this.debug = options.debug;
|
|
48
|
+
// Determine console logging: if explicitly set, use that value; otherwise default to true
|
|
49
|
+
this.consoleEnabled = options.consoleLogging !== undefined ? options.consoleLogging : true;
|
|
50
|
+
// Determine file logging: if explicitly set, use that value; otherwise use debug setting
|
|
51
|
+
this.fileEnabled = options.fileLogging !== undefined ? options.fileLogging : (this.debug ?? false);
|
|
36
52
|
const dir = options.dir ?? './logs';
|
|
37
|
-
if (!fs.existsSync(dir)) {
|
|
53
|
+
if (this.fileEnabled && !fs.existsSync(dir)) {
|
|
38
54
|
fs.mkdirSync(dir);
|
|
39
55
|
}
|
|
40
56
|
this.filePath = path.join(dir, 'log.txt');
|
|
41
57
|
}
|
|
42
58
|
log(message) {
|
|
43
59
|
const logMessage = `[INFO] qase: ${message}`;
|
|
44
|
-
|
|
45
|
-
|
|
60
|
+
if (this.consoleEnabled) {
|
|
61
|
+
console.log(logMessage);
|
|
62
|
+
}
|
|
63
|
+
if (this.fileEnabled) {
|
|
46
64
|
this.logToFile(logMessage);
|
|
47
65
|
}
|
|
48
66
|
}
|
|
49
67
|
logError(message, error) {
|
|
50
68
|
const logMessage = `[ERROR] qase: ${this.doLogError(message, error)}`;
|
|
51
|
-
|
|
52
|
-
|
|
69
|
+
if (this.consoleEnabled) {
|
|
70
|
+
console.error(logMessage);
|
|
71
|
+
}
|
|
72
|
+
if (this.fileEnabled) {
|
|
53
73
|
this.logToFile(logMessage);
|
|
54
74
|
}
|
|
55
75
|
}
|
|
56
76
|
logDebug(message) {
|
|
57
77
|
if (this.debug) {
|
|
58
78
|
const logMessage = `[DEBUG] qase: ${message}`;
|
|
59
|
-
|
|
60
|
-
|
|
79
|
+
if (this.consoleEnabled) {
|
|
80
|
+
console.log(logMessage);
|
|
81
|
+
}
|
|
82
|
+
if (this.fileEnabled) {
|
|
83
|
+
this.logToFile(logMessage);
|
|
84
|
+
}
|
|
61
85
|
}
|
|
62
86
|
}
|
|
63
87
|
logToFile(message) {
|
package/dist/utils/mimeTypes.js
CHANGED
|
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getMimeTypes =
|
|
36
|
+
exports.getMimeTypes = getMimeTypes;
|
|
27
37
|
const path = __importStar(require("path"));
|
|
28
38
|
const mime = __importStar(require("mime-types"));
|
|
29
39
|
/**
|
|
@@ -38,4 +48,3 @@ function getMimeTypes(filePath) {
|
|
|
38
48
|
}
|
|
39
49
|
return mimeType;
|
|
40
50
|
}
|
|
41
|
-
exports.getMimeTypes = getMimeTypes;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.applyStatusMapping = applyStatusMapping;
|
|
4
|
+
exports.validateStatusMapping = validateStatusMapping;
|
|
4
5
|
const test_execution_1 = require("../models/test-execution");
|
|
5
6
|
/**
|
|
6
7
|
* Applies status mapping configuration to a test status
|
|
@@ -24,7 +25,6 @@ function applyStatusMapping(status, statusMapping) {
|
|
|
24
25
|
}
|
|
25
26
|
return mappedStatus;
|
|
26
27
|
}
|
|
27
|
-
exports.applyStatusMapping = applyStatusMapping;
|
|
28
28
|
/**
|
|
29
29
|
* Validates status mapping configuration
|
|
30
30
|
* @param statusMapping - Status mapping configuration to validate
|
|
@@ -43,4 +43,3 @@ function validateStatusMapping(statusMapping) {
|
|
|
43
43
|
}
|
|
44
44
|
return errors;
|
|
45
45
|
}
|
|
46
|
-
exports.validateStatusMapping = validateStatusMapping;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.determineTestStatus =
|
|
3
|
+
exports.determineTestStatus = determineTestStatus;
|
|
4
4
|
const test_execution_1 = require("../models/test-execution");
|
|
5
5
|
/**
|
|
6
6
|
* Determines test status based on error type
|
|
@@ -20,7 +20,6 @@ function determineTestStatus(error, originalStatus) {
|
|
|
20
20
|
// For all other errors, return invalid
|
|
21
21
|
return test_execution_1.TestStatusEnum.invalid;
|
|
22
22
|
}
|
|
23
|
-
exports.determineTestStatus = determineTestStatus;
|
|
24
23
|
/**
|
|
25
24
|
* Checks if error is an assertion error
|
|
26
25
|
* @param error - Error object
|
|
@@ -100,5 +99,7 @@ function mapOriginalStatus(originalStatus) {
|
|
|
100
99
|
'timedOut': test_execution_1.TestStatusEnum.failed,
|
|
101
100
|
'interrupted': test_execution_1.TestStatusEnum.failed,
|
|
102
101
|
};
|
|
103
|
-
|
|
102
|
+
// Convert to lowercase for case-insensitive matching
|
|
103
|
+
const normalizedStatus = originalStatus.toLowerCase();
|
|
104
|
+
return statusMap[normalizedStatus] || test_execution_1.TestStatusEnum.skipped;
|
|
104
105
|
}
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.JsonValidationError = void 0;
|
|
7
|
+
exports.validateJson = validateJson;
|
|
7
8
|
const ajv_1 = __importDefault(require("ajv"));
|
|
8
9
|
/**
|
|
9
10
|
* @type {Ajv}
|
|
@@ -38,4 +39,3 @@ function validateJson(schema, json) {
|
|
|
38
39
|
throw new JsonValidationError(validator.errors ? [...validator.errors] : []);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
|
-
exports.validateJson = validateJson;
|
package/dist/writer/fs-writer.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.FsWriter = void 0;
|
|
27
37
|
const fs_1 = require("fs");
|