@qanalyzer/forge-commons 1.1.1
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/LICENSE +202 -0
- package/dist/ci/context.d.ts +6 -0
- package/dist/ci/context.js +71 -0
- package/dist/ci/frameworks/jest.d.ts +1 -0
- package/dist/ci/frameworks/jest.js +6 -0
- package/dist/ci/frameworks/reporter.d.ts +41 -0
- package/dist/ci/frameworks/reporter.js +184 -0
- package/dist/ci/frameworks/upload.d.ts +10 -0
- package/dist/ci/frameworks/upload.js +58 -0
- package/dist/ci/frameworks/vitest.d.ts +2 -0
- package/dist/ci/frameworks/vitest.js +10 -0
- package/dist/ci/generate-ci-template.d.ts +7 -0
- package/dist/ci/generate-ci-template.js +79 -0
- package/dist/ci/index.d.ts +7 -0
- package/dist/ci/index.js +36 -0
- package/dist/ci/templates/azure-devops.d.ts +5 -0
- package/dist/ci/templates/azure-devops.js +142 -0
- package/dist/ci/templates/bitbucket.d.ts +5 -0
- package/dist/ci/templates/bitbucket.js +113 -0
- package/dist/ci/templates/github.d.ts +6 -0
- package/dist/ci/templates/github.js +156 -0
- package/dist/ci/templates/gitlab.d.ts +5 -0
- package/dist/ci/templates/gitlab.js +124 -0
- package/dist/ci/templates/jenkins.d.ts +5 -0
- package/dist/ci/templates/jenkins.js +125 -0
- package/dist/ci/types.d.ts +58 -0
- package/dist/ci/types.js +16 -0
- package/dist/client/attach-client.d.ts +48 -0
- package/dist/client/attach-client.js +122 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +8 -0
- package/dist/client/ingest-client.d.ts +19 -0
- package/dist/client/ingest-client.js +66 -0
- package/dist/config/config-loader.d.ts +8 -0
- package/dist/config/config-loader.js +62 -0
- package/dist/config/config-type.d.ts +24 -0
- package/dist/config/config-type.js +2 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +6 -0
- package/dist/env/ci-environment.d.ts +10 -0
- package/dist/env/ci-environment.js +59 -0
- package/dist/env/env-enum.d.ts +21 -0
- package/dist/env/env-enum.js +27 -0
- package/dist/env/env-to-config.d.ts +3 -0
- package/dist/env/env-to-config.js +53 -0
- package/dist/env/index.d.ts +4 -0
- package/dist/env/index.js +11 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +59 -0
- package/dist/models/attachment.d.ts +9 -0
- package/dist/models/attachment.js +2 -0
- package/dist/models/execution-sum.d.ts +7 -0
- package/dist/models/execution-sum.js +2 -0
- package/dist/models/host-data.d.ts +13 -0
- package/dist/models/host-data.js +2 -0
- package/dist/models/index.d.ts +14 -0
- package/dist/models/index.js +24 -0
- package/dist/models/ingest-payload.d.ts +56 -0
- package/dist/models/ingest-payload.js +56 -0
- package/dist/models/jest-vitest-report.d.ts +37 -0
- package/dist/models/jest-vitest-report.js +2 -0
- package/dist/models/meta-qa.d.ts +71 -0
- package/dist/models/meta-qa.js +257 -0
- package/dist/models/report.d.ts +15 -0
- package/dist/models/report.js +2 -0
- package/dist/models/short-result.d.ts +8 -0
- package/dist/models/short-result.js +2 -0
- package/dist/models/stats.d.ts +10 -0
- package/dist/models/stats.js +2 -0
- package/dist/models/step-data.d.ts +20 -0
- package/dist/models/step-data.js +2 -0
- package/dist/models/step-execution.d.ts +14 -0
- package/dist/models/step-execution.js +24 -0
- package/dist/models/test-execution.d.ts +18 -0
- package/dist/models/test-execution.js +30 -0
- package/dist/models/test-result.d.ts +34 -0
- package/dist/models/test-result.js +43 -0
- package/dist/models/test-step.d.ts +19 -0
- package/dist/models/test-step.js +46 -0
- package/dist/options/compose-options.d.ts +2 -0
- package/dist/options/compose-options.js +26 -0
- package/dist/options/index.d.ts +3 -0
- package/dist/options/index.js +7 -0
- package/dist/options/mode-enum.d.ts +5 -0
- package/dist/options/mode-enum.js +9 -0
- package/dist/options/options-type.d.ts +11 -0
- package/dist/options/options-type.js +2 -0
- package/dist/qanalyzer/index.d.ts +2 -0
- package/dist/qanalyzer/index.js +8 -0
- package/dist/qanalyzer/options-resolver.d.ts +11 -0
- package/dist/qanalyzer/options-resolver.js +31 -0
- package/dist/qanalyzer/reporter-factory.d.ts +11 -0
- package/dist/qanalyzer/reporter-factory.js +51 -0
- package/dist/qanalyzer.d.ts +29 -0
- package/dist/qanalyzer.js +96 -0
- package/dist/reporters/fallback-coordinator.d.ts +24 -0
- package/dist/reporters/fallback-coordinator.js +77 -0
- package/dist/reporters/file-reporter.d.ts +10 -0
- package/dist/reporters/file-reporter.js +16 -0
- package/dist/reporters/index.d.ts +4 -0
- package/dist/reporters/index.js +9 -0
- package/dist/reporters/ingest-reporter.d.ts +9 -0
- package/dist/reporters/ingest-reporter.js +14 -0
- package/dist/reporters/reporter-interface.d.ts +4 -0
- package/dist/reporters/reporter-interface.js +2 -0
- package/dist/utils/disabled-exception.d.ts +2 -0
- package/dist/utils/disabled-exception.js +6 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +17 -0
- package/dist/utils/issue-keys.d.ts +7 -0
- package/dist/utils/issue-keys.js +33 -0
- package/dist/utils/logger.d.ts +12 -0
- package/dist/utils/logger.js +21 -0
- package/dist/utils/token-masker.d.ts +2 -0
- package/dist/utils/token-masker.js +17 -0
- package/dist/utils/upload-attachment.d.ts +35 -0
- package/dist/utils/upload-attachment.js +158 -0
- package/dist/writer/fs-writer.d.ts +9 -0
- package/dist/writer/fs-writer.js +19 -0
- package/dist/writer/index.d.ts +1 -0
- package/dist/writer/index.js +5 -0
- package/package.json +34 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ModeEnum } from '../options';
|
|
2
|
+
export type IngestOptionsType = {
|
|
3
|
+
url?: string;
|
|
4
|
+
token?: string;
|
|
5
|
+
timeoutMs?: number;
|
|
6
|
+
maxPayloadBytes?: number;
|
|
7
|
+
};
|
|
8
|
+
export type FileOptionsType = {
|
|
9
|
+
path?: string;
|
|
10
|
+
};
|
|
11
|
+
export type ConfigType = {
|
|
12
|
+
mode?: `${ModeEnum}`;
|
|
13
|
+
fallback?: `${ModeEnum}`;
|
|
14
|
+
projectKey?: string;
|
|
15
|
+
launchName?: string;
|
|
16
|
+
planId?: string;
|
|
17
|
+
planKey?: string;
|
|
18
|
+
planName?: string;
|
|
19
|
+
fixVersion?: string;
|
|
20
|
+
sprintName?: string;
|
|
21
|
+
debug?: boolean;
|
|
22
|
+
ingest?: IngestOptionsType;
|
|
23
|
+
file?: FileOptionsType;
|
|
24
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadConfig = exports.ConfigLoader = void 0;
|
|
4
|
+
var config_loader_1 = require("./config-loader");
|
|
5
|
+
Object.defineProperty(exports, "ConfigLoader", { enumerable: true, get: function () { return config_loader_1.ConfigLoader; } });
|
|
6
|
+
Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return config_loader_1.loadConfig; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type CiMetadata = {
|
|
2
|
+
ciPlatform?: string;
|
|
3
|
+
buildUrl?: string;
|
|
4
|
+
gitCommitSha?: string;
|
|
5
|
+
gitBranch?: string;
|
|
6
|
+
gitAuthorName?: string;
|
|
7
|
+
gitAuthorEmail?: string;
|
|
8
|
+
};
|
|
9
|
+
/** Best-effort CI metadata from common provider env vars. */
|
|
10
|
+
export declare function detectCiEnvironment(): CiMetadata;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.detectCiEnvironment = detectCiEnvironment;
|
|
4
|
+
function firstDefined(...values) {
|
|
5
|
+
return values.find((value) => value !== undefined && value !== '');
|
|
6
|
+
}
|
|
7
|
+
/** Best-effort CI metadata from common provider env vars. */
|
|
8
|
+
function detectCiEnvironment() {
|
|
9
|
+
const github = process.env.GITHUB_ACTIONS === 'true';
|
|
10
|
+
const gitlab = Boolean(process.env.GITLAB_CI);
|
|
11
|
+
const azure = Boolean(process.env.TF_BUILD);
|
|
12
|
+
const bitbucket = Boolean(process.env.BITBUCKET_BUILD_NUMBER);
|
|
13
|
+
const teamcity = Boolean(process.env.TEAMCITY_VERSION);
|
|
14
|
+
const jenkins = Boolean(process.env.JENKINS_URL);
|
|
15
|
+
let ciPlatform;
|
|
16
|
+
let buildUrl;
|
|
17
|
+
if (github) {
|
|
18
|
+
ciPlatform = 'github';
|
|
19
|
+
const server = process.env.GITHUB_SERVER_URL ?? 'https://github.com';
|
|
20
|
+
const repo = process.env.GITHUB_REPOSITORY;
|
|
21
|
+
const runId = process.env.GITHUB_RUN_ID;
|
|
22
|
+
if (repo && runId) {
|
|
23
|
+
buildUrl = `${server}/${repo}/actions/runs/${runId}`;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else if (gitlab) {
|
|
27
|
+
ciPlatform = 'gitlab';
|
|
28
|
+
buildUrl = process.env.CI_PIPELINE_URL;
|
|
29
|
+
}
|
|
30
|
+
else if (azure) {
|
|
31
|
+
ciPlatform = 'azure-devops';
|
|
32
|
+
const collection = process.env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI;
|
|
33
|
+
const project = process.env.SYSTEM_TEAMPROJECT;
|
|
34
|
+
const buildId = process.env.BUILD_BUILDID;
|
|
35
|
+
if (collection && project && buildId) {
|
|
36
|
+
buildUrl = `${collection}${project}/_build/results?buildId=${buildId}`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else if (bitbucket) {
|
|
40
|
+
ciPlatform = 'bitbucket';
|
|
41
|
+
buildUrl = process.env.BITBUCKET_GIT_HTTP_ORIGIN;
|
|
42
|
+
}
|
|
43
|
+
else if (teamcity) {
|
|
44
|
+
ciPlatform = 'teamcity';
|
|
45
|
+
buildUrl = process.env.BUILD_URL;
|
|
46
|
+
}
|
|
47
|
+
else if (jenkins) {
|
|
48
|
+
ciPlatform = 'jenkins';
|
|
49
|
+
buildUrl = process.env.BUILD_URL;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
ciPlatform,
|
|
53
|
+
buildUrl,
|
|
54
|
+
gitCommitSha: firstDefined(process.env.GITHUB_SHA, process.env.CI_COMMIT_SHA, process.env.BUILD_SOURCEVERSION, process.env.BITBUCKET_COMMIT),
|
|
55
|
+
gitBranch: firstDefined(process.env.GITHUB_REF_NAME, process.env.CI_COMMIT_REF_NAME, process.env.BUILD_SOURCEBRANCHNAME, process.env.BITBUCKET_BRANCH),
|
|
56
|
+
gitAuthorName: firstDefined(process.env.GITHUB_ACTOR, process.env.GITLAB_USER_NAME),
|
|
57
|
+
gitAuthorEmail: process.env.GITLAB_USER_EMAIL,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare enum EnvEnum {
|
|
2
|
+
mode = "QANALYZER_MODE",
|
|
3
|
+
fallback = "QANALYZER_FALLBACK",
|
|
4
|
+
debug = "QANALYZER_DEBUG",
|
|
5
|
+
projectKey = "QANALYZER_PROJECT_KEY",
|
|
6
|
+
launchName = "QANALYZER_LAUNCH_NAME",
|
|
7
|
+
planId = "QANALYZER_PLAN_ID",
|
|
8
|
+
planKey = "QANALYZER_PLAN_KEY",
|
|
9
|
+
planName = "QANALYZER_PLAN_NAME",
|
|
10
|
+
fixVersion = "QANALYZER_FIX_VERSION",
|
|
11
|
+
sprintName = "QANALYZER_SPRINT"
|
|
12
|
+
}
|
|
13
|
+
export declare enum EnvIngestEnum {
|
|
14
|
+
url = "QANALYZER_INGEST_URL",
|
|
15
|
+
token = "QANALYZER_INGEST_TOKEN",
|
|
16
|
+
timeoutMs = "QANALYZER_INGEST_TIMEOUT_MS",
|
|
17
|
+
maxPayloadBytes = "QANALYZER_INGEST_MAX_PAYLOAD_BYTES"
|
|
18
|
+
}
|
|
19
|
+
export declare enum EnvFileEnum {
|
|
20
|
+
path = "QANALYZER_FILE_PATH"
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnvFileEnum = exports.EnvIngestEnum = exports.EnvEnum = void 0;
|
|
4
|
+
var EnvEnum;
|
|
5
|
+
(function (EnvEnum) {
|
|
6
|
+
EnvEnum["mode"] = "QANALYZER_MODE";
|
|
7
|
+
EnvEnum["fallback"] = "QANALYZER_FALLBACK";
|
|
8
|
+
EnvEnum["debug"] = "QANALYZER_DEBUG";
|
|
9
|
+
EnvEnum["projectKey"] = "QANALYZER_PROJECT_KEY";
|
|
10
|
+
EnvEnum["launchName"] = "QANALYZER_LAUNCH_NAME";
|
|
11
|
+
EnvEnum["planId"] = "QANALYZER_PLAN_ID";
|
|
12
|
+
EnvEnum["planKey"] = "QANALYZER_PLAN_KEY";
|
|
13
|
+
EnvEnum["planName"] = "QANALYZER_PLAN_NAME";
|
|
14
|
+
EnvEnum["fixVersion"] = "QANALYZER_FIX_VERSION";
|
|
15
|
+
EnvEnum["sprintName"] = "QANALYZER_SPRINT";
|
|
16
|
+
})(EnvEnum || (exports.EnvEnum = EnvEnum = {}));
|
|
17
|
+
var EnvIngestEnum;
|
|
18
|
+
(function (EnvIngestEnum) {
|
|
19
|
+
EnvIngestEnum["url"] = "QANALYZER_INGEST_URL";
|
|
20
|
+
EnvIngestEnum["token"] = "QANALYZER_INGEST_TOKEN";
|
|
21
|
+
EnvIngestEnum["timeoutMs"] = "QANALYZER_INGEST_TIMEOUT_MS";
|
|
22
|
+
EnvIngestEnum["maxPayloadBytes"] = "QANALYZER_INGEST_MAX_PAYLOAD_BYTES";
|
|
23
|
+
})(EnvIngestEnum || (exports.EnvIngestEnum = EnvIngestEnum = {}));
|
|
24
|
+
var EnvFileEnum;
|
|
25
|
+
(function (EnvFileEnum) {
|
|
26
|
+
EnvFileEnum["path"] = "QANALYZER_FILE_PATH";
|
|
27
|
+
})(EnvFileEnum || (exports.EnvFileEnum = EnvFileEnum = {}));
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.envToConfig = envToConfig;
|
|
4
|
+
const env_enum_1 = require("./env-enum");
|
|
5
|
+
function readEnv(name) {
|
|
6
|
+
const value = process.env[name];
|
|
7
|
+
return value === '' ? undefined : value;
|
|
8
|
+
}
|
|
9
|
+
function readBoolean(name) {
|
|
10
|
+
const value = readEnv(name);
|
|
11
|
+
if (value === undefined)
|
|
12
|
+
return undefined;
|
|
13
|
+
return value === '1' || value.toLowerCase() === 'true';
|
|
14
|
+
}
|
|
15
|
+
function readNumber(name) {
|
|
16
|
+
const value = readEnv(name);
|
|
17
|
+
if (value === undefined)
|
|
18
|
+
return undefined;
|
|
19
|
+
const parsed = Number(value);
|
|
20
|
+
return Number.isFinite(parsed) ? parsed : undefined;
|
|
21
|
+
}
|
|
22
|
+
/** Map QANALYZER_* env vars to nested config (highest precedence in composeOptions). */
|
|
23
|
+
function envToConfig() {
|
|
24
|
+
const config = {
|
|
25
|
+
mode: readEnv(env_enum_1.EnvEnum.mode),
|
|
26
|
+
fallback: readEnv(env_enum_1.EnvEnum.fallback),
|
|
27
|
+
debug: readBoolean(env_enum_1.EnvEnum.debug),
|
|
28
|
+
projectKey: readEnv(env_enum_1.EnvEnum.projectKey),
|
|
29
|
+
launchName: readEnv(env_enum_1.EnvEnum.launchName),
|
|
30
|
+
planId: readEnv(env_enum_1.EnvEnum.planId),
|
|
31
|
+
planKey: readEnv(env_enum_1.EnvEnum.planKey),
|
|
32
|
+
planName: readEnv(env_enum_1.EnvEnum.planName),
|
|
33
|
+
fixVersion: readEnv(env_enum_1.EnvEnum.fixVersion),
|
|
34
|
+
sprintName: readEnv(env_enum_1.EnvEnum.sprintName),
|
|
35
|
+
ingest: {
|
|
36
|
+
url: readEnv(env_enum_1.EnvIngestEnum.url),
|
|
37
|
+
token: readEnv(env_enum_1.EnvIngestEnum.token),
|
|
38
|
+
timeoutMs: readNumber(env_enum_1.EnvIngestEnum.timeoutMs),
|
|
39
|
+
maxPayloadBytes: readNumber(env_enum_1.EnvIngestEnum.maxPayloadBytes),
|
|
40
|
+
},
|
|
41
|
+
file: {
|
|
42
|
+
path: readEnv(env_enum_1.EnvFileEnum.path),
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
if (config.ingest &&
|
|
46
|
+
Object.values(config.ingest).every((value) => value === undefined)) {
|
|
47
|
+
delete config.ingest;
|
|
48
|
+
}
|
|
49
|
+
if (config.file && Object.values(config.file).every((value) => value === undefined)) {
|
|
50
|
+
delete config.file;
|
|
51
|
+
}
|
|
52
|
+
return config;
|
|
53
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.detectCiEnvironment = exports.envToConfig = exports.EnvFileEnum = exports.EnvIngestEnum = exports.EnvEnum = void 0;
|
|
4
|
+
var env_enum_1 = require("./env-enum");
|
|
5
|
+
Object.defineProperty(exports, "EnvEnum", { enumerable: true, get: function () { return env_enum_1.EnvEnum; } });
|
|
6
|
+
Object.defineProperty(exports, "EnvIngestEnum", { enumerable: true, get: function () { return env_enum_1.EnvIngestEnum; } });
|
|
7
|
+
Object.defineProperty(exports, "EnvFileEnum", { enumerable: true, get: function () { return env_enum_1.EnvFileEnum; } });
|
|
8
|
+
var env_to_config_1 = require("./env-to-config");
|
|
9
|
+
Object.defineProperty(exports, "envToConfig", { enumerable: true, get: function () { return env_to_config_1.envToConfig; } });
|
|
10
|
+
var ci_environment_1 = require("./ci-environment");
|
|
11
|
+
Object.defineProperty(exports, "detectCiEnvironment", { enumerable: true, get: function () { return ci_environment_1.detectCiEnvironment; } });
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { QAnalyzerReporter, type PublishReportOptions } from './qanalyzer';
|
|
2
|
+
export { ConfigLoader, loadConfig, type ConfigType } from './config';
|
|
3
|
+
export { envToConfig, detectCiEnvironment, EnvEnum, EnvIngestEnum, EnvFileEnum } from './env';
|
|
4
|
+
export type { CiMetadata } from './env';
|
|
5
|
+
export { composeOptions, ModeEnum, type OptionsType } from './options';
|
|
6
|
+
export { buildIngestPayload, estimatePayloadBytes, normalizeJestReport, applyQaAnnotation, applyQaAnnotations, createQaMetaAccumulator, qaMetaFromEntries, toQaMetaWire, TestResultType, TestStepType, TestExecution, TestStatusEnum, StepType, StepExecution, StepStatusEnum, type IngestPayload, type IngestFormat, type JestVitestJsonReport, type JestAssertionResult, type JestTestFileResult, type QaAnnotationLike, type QaMetaAccumulator, type QaMetaWire, type QaMetaStepWire, type QaMetaAttachmentWire, type QaMetaFramework, type Report, type Stats, type ShortResult, type HostData, type Attachment, type Relation, type Suite, type SuiteData, } from './models';
|
|
7
|
+
export { IngestClient, AttachClient, DEFAULT_MAX_ATTACH_BYTES, type IngestResponse } from './client';
|
|
8
|
+
export { FsWriter } from './writer';
|
|
9
|
+
export { FallbackCoordinator, IngestReporter, FileReporter } from './reporters';
|
|
10
|
+
export { Logger, sanitizeOptionsForLog, extractIssueKeys, firstIssueKey, projectKeyFromIssueKey, uploadAttachmentForQa, EnvAttachEnum, } from './utils';
|
|
11
|
+
export { generateCiTemplate, buildCiTemplateContext, listCiTemplateVariants, UnsupportedVariantError, vitestJsonRun, jestJsonRun, type CiTemplateContext, type CiTemplateResult, type CiTemplateVariant, type CiPlatform, type CiFramework, type CiIngestPath, type CiSecretHint, type CiVariableHint, } from './ci';
|
|
12
|
+
export declare const PACKAGE_NAME = "@qanalyzer/forge-commons";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PACKAGE_NAME = exports.jestJsonRun = exports.vitestJsonRun = exports.UnsupportedVariantError = exports.listCiTemplateVariants = exports.buildCiTemplateContext = exports.generateCiTemplate = exports.EnvAttachEnum = exports.uploadAttachmentForQa = exports.projectKeyFromIssueKey = exports.firstIssueKey = exports.extractIssueKeys = exports.sanitizeOptionsForLog = exports.Logger = exports.FileReporter = exports.IngestReporter = exports.FallbackCoordinator = exports.FsWriter = exports.DEFAULT_MAX_ATTACH_BYTES = exports.AttachClient = exports.IngestClient = exports.StepStatusEnum = exports.StepExecution = exports.StepType = exports.TestStatusEnum = exports.TestExecution = exports.TestStepType = exports.TestResultType = exports.toQaMetaWire = exports.qaMetaFromEntries = exports.createQaMetaAccumulator = exports.applyQaAnnotations = exports.applyQaAnnotation = exports.normalizeJestReport = exports.estimatePayloadBytes = exports.buildIngestPayload = exports.ModeEnum = exports.composeOptions = exports.EnvFileEnum = exports.EnvIngestEnum = exports.EnvEnum = exports.detectCiEnvironment = exports.envToConfig = exports.loadConfig = exports.ConfigLoader = exports.QAnalyzerReporter = void 0;
|
|
4
|
+
var qanalyzer_1 = require("./qanalyzer");
|
|
5
|
+
Object.defineProperty(exports, "QAnalyzerReporter", { enumerable: true, get: function () { return qanalyzer_1.QAnalyzerReporter; } });
|
|
6
|
+
var config_1 = require("./config");
|
|
7
|
+
Object.defineProperty(exports, "ConfigLoader", { enumerable: true, get: function () { return config_1.ConfigLoader; } });
|
|
8
|
+
Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return config_1.loadConfig; } });
|
|
9
|
+
var env_1 = require("./env");
|
|
10
|
+
Object.defineProperty(exports, "envToConfig", { enumerable: true, get: function () { return env_1.envToConfig; } });
|
|
11
|
+
Object.defineProperty(exports, "detectCiEnvironment", { enumerable: true, get: function () { return env_1.detectCiEnvironment; } });
|
|
12
|
+
Object.defineProperty(exports, "EnvEnum", { enumerable: true, get: function () { return env_1.EnvEnum; } });
|
|
13
|
+
Object.defineProperty(exports, "EnvIngestEnum", { enumerable: true, get: function () { return env_1.EnvIngestEnum; } });
|
|
14
|
+
Object.defineProperty(exports, "EnvFileEnum", { enumerable: true, get: function () { return env_1.EnvFileEnum; } });
|
|
15
|
+
var options_1 = require("./options");
|
|
16
|
+
Object.defineProperty(exports, "composeOptions", { enumerable: true, get: function () { return options_1.composeOptions; } });
|
|
17
|
+
Object.defineProperty(exports, "ModeEnum", { enumerable: true, get: function () { return options_1.ModeEnum; } });
|
|
18
|
+
var models_1 = require("./models");
|
|
19
|
+
Object.defineProperty(exports, "buildIngestPayload", { enumerable: true, get: function () { return models_1.buildIngestPayload; } });
|
|
20
|
+
Object.defineProperty(exports, "estimatePayloadBytes", { enumerable: true, get: function () { return models_1.estimatePayloadBytes; } });
|
|
21
|
+
Object.defineProperty(exports, "normalizeJestReport", { enumerable: true, get: function () { return models_1.normalizeJestReport; } });
|
|
22
|
+
Object.defineProperty(exports, "applyQaAnnotation", { enumerable: true, get: function () { return models_1.applyQaAnnotation; } });
|
|
23
|
+
Object.defineProperty(exports, "applyQaAnnotations", { enumerable: true, get: function () { return models_1.applyQaAnnotations; } });
|
|
24
|
+
Object.defineProperty(exports, "createQaMetaAccumulator", { enumerable: true, get: function () { return models_1.createQaMetaAccumulator; } });
|
|
25
|
+
Object.defineProperty(exports, "qaMetaFromEntries", { enumerable: true, get: function () { return models_1.qaMetaFromEntries; } });
|
|
26
|
+
Object.defineProperty(exports, "toQaMetaWire", { enumerable: true, get: function () { return models_1.toQaMetaWire; } });
|
|
27
|
+
Object.defineProperty(exports, "TestResultType", { enumerable: true, get: function () { return models_1.TestResultType; } });
|
|
28
|
+
Object.defineProperty(exports, "TestStepType", { enumerable: true, get: function () { return models_1.TestStepType; } });
|
|
29
|
+
Object.defineProperty(exports, "TestExecution", { enumerable: true, get: function () { return models_1.TestExecution; } });
|
|
30
|
+
Object.defineProperty(exports, "TestStatusEnum", { enumerable: true, get: function () { return models_1.TestStatusEnum; } });
|
|
31
|
+
Object.defineProperty(exports, "StepType", { enumerable: true, get: function () { return models_1.StepType; } });
|
|
32
|
+
Object.defineProperty(exports, "StepExecution", { enumerable: true, get: function () { return models_1.StepExecution; } });
|
|
33
|
+
Object.defineProperty(exports, "StepStatusEnum", { enumerable: true, get: function () { return models_1.StepStatusEnum; } });
|
|
34
|
+
var client_1 = require("./client");
|
|
35
|
+
Object.defineProperty(exports, "IngestClient", { enumerable: true, get: function () { return client_1.IngestClient; } });
|
|
36
|
+
Object.defineProperty(exports, "AttachClient", { enumerable: true, get: function () { return client_1.AttachClient; } });
|
|
37
|
+
Object.defineProperty(exports, "DEFAULT_MAX_ATTACH_BYTES", { enumerable: true, get: function () { return client_1.DEFAULT_MAX_ATTACH_BYTES; } });
|
|
38
|
+
var writer_1 = require("./writer");
|
|
39
|
+
Object.defineProperty(exports, "FsWriter", { enumerable: true, get: function () { return writer_1.FsWriter; } });
|
|
40
|
+
var reporters_1 = require("./reporters");
|
|
41
|
+
Object.defineProperty(exports, "FallbackCoordinator", { enumerable: true, get: function () { return reporters_1.FallbackCoordinator; } });
|
|
42
|
+
Object.defineProperty(exports, "IngestReporter", { enumerable: true, get: function () { return reporters_1.IngestReporter; } });
|
|
43
|
+
Object.defineProperty(exports, "FileReporter", { enumerable: true, get: function () { return reporters_1.FileReporter; } });
|
|
44
|
+
var utils_1 = require("./utils");
|
|
45
|
+
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return utils_1.Logger; } });
|
|
46
|
+
Object.defineProperty(exports, "sanitizeOptionsForLog", { enumerable: true, get: function () { return utils_1.sanitizeOptionsForLog; } });
|
|
47
|
+
Object.defineProperty(exports, "extractIssueKeys", { enumerable: true, get: function () { return utils_1.extractIssueKeys; } });
|
|
48
|
+
Object.defineProperty(exports, "firstIssueKey", { enumerable: true, get: function () { return utils_1.firstIssueKey; } });
|
|
49
|
+
Object.defineProperty(exports, "projectKeyFromIssueKey", { enumerable: true, get: function () { return utils_1.projectKeyFromIssueKey; } });
|
|
50
|
+
Object.defineProperty(exports, "uploadAttachmentForQa", { enumerable: true, get: function () { return utils_1.uploadAttachmentForQa; } });
|
|
51
|
+
Object.defineProperty(exports, "EnvAttachEnum", { enumerable: true, get: function () { return utils_1.EnvAttachEnum; } });
|
|
52
|
+
var ci_1 = require("./ci");
|
|
53
|
+
Object.defineProperty(exports, "generateCiTemplate", { enumerable: true, get: function () { return ci_1.generateCiTemplate; } });
|
|
54
|
+
Object.defineProperty(exports, "buildCiTemplateContext", { enumerable: true, get: function () { return ci_1.buildCiTemplateContext; } });
|
|
55
|
+
Object.defineProperty(exports, "listCiTemplateVariants", { enumerable: true, get: function () { return ci_1.listCiTemplateVariants; } });
|
|
56
|
+
Object.defineProperty(exports, "UnsupportedVariantError", { enumerable: true, get: function () { return ci_1.UnsupportedVariantError; } });
|
|
57
|
+
Object.defineProperty(exports, "vitestJsonRun", { enumerable: true, get: function () { return ci_1.vitestJsonRun; } });
|
|
58
|
+
Object.defineProperty(exports, "jestJsonRun", { enumerable: true, get: function () { return ci_1.jestJsonRun; } });
|
|
59
|
+
exports.PACKAGE_NAME = '@qanalyzer/forge-commons';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Runtime host metadata captured with a launch. */
|
|
2
|
+
export interface HostData {
|
|
3
|
+
system: string;
|
|
4
|
+
machineName: string;
|
|
5
|
+
release: string;
|
|
6
|
+
version: string;
|
|
7
|
+
arch: string;
|
|
8
|
+
language: string;
|
|
9
|
+
packageManager: string;
|
|
10
|
+
framework: string;
|
|
11
|
+
reporter: string;
|
|
12
|
+
commons: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { TestResultType, type Relation, type Suite, type SuiteData } from './test-result';
|
|
2
|
+
export { TestExecution, TestStatusEnum } from './test-execution';
|
|
3
|
+
export { TestStepType, StepType } from './test-step';
|
|
4
|
+
export type { StepRequestData, StepTextData, StepGherkinData } from './step-data';
|
|
5
|
+
export { StepExecution, StepStatusEnum } from './step-execution';
|
|
6
|
+
export type { Attachment } from './attachment';
|
|
7
|
+
export type { Report } from './report';
|
|
8
|
+
export type { Stats } from './stats';
|
|
9
|
+
export type { ShortResult } from './short-result';
|
|
10
|
+
export type { HostData } from './host-data';
|
|
11
|
+
export type { ExecutionSum } from './execution-sum';
|
|
12
|
+
export type { JestVitestJsonReport, JestTestFileResult, JestAssertionResult } from './jest-vitest-report';
|
|
13
|
+
export { applyQaAnnotation, applyQaAnnotations, createQaMetaAccumulator, qaMetaFromEntries, toQaMetaWire, type QaAnnotationLike, type QaMetaAccumulator, type QaMetaAttachmentWire, type QaMetaStepWire, type QaMetaWire, type QaMetaFramework, type ToQaMetaWireOptions, } from './meta-qa';
|
|
14
|
+
export { buildIngestPayload, estimatePayloadBytes, normalizeJestReport, type BuildIngestPayloadInput, type IngestFormat, type IngestPayload, } from './ingest-payload';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeJestReport = exports.estimatePayloadBytes = exports.buildIngestPayload = exports.toQaMetaWire = exports.qaMetaFromEntries = exports.createQaMetaAccumulator = exports.applyQaAnnotations = exports.applyQaAnnotation = exports.StepStatusEnum = exports.StepExecution = exports.StepType = exports.TestStepType = exports.TestStatusEnum = exports.TestExecution = exports.TestResultType = void 0;
|
|
4
|
+
var test_result_1 = require("./test-result");
|
|
5
|
+
Object.defineProperty(exports, "TestResultType", { enumerable: true, get: function () { return test_result_1.TestResultType; } });
|
|
6
|
+
var test_execution_1 = require("./test-execution");
|
|
7
|
+
Object.defineProperty(exports, "TestExecution", { enumerable: true, get: function () { return test_execution_1.TestExecution; } });
|
|
8
|
+
Object.defineProperty(exports, "TestStatusEnum", { enumerable: true, get: function () { return test_execution_1.TestStatusEnum; } });
|
|
9
|
+
var test_step_1 = require("./test-step");
|
|
10
|
+
Object.defineProperty(exports, "TestStepType", { enumerable: true, get: function () { return test_step_1.TestStepType; } });
|
|
11
|
+
Object.defineProperty(exports, "StepType", { enumerable: true, get: function () { return test_step_1.StepType; } });
|
|
12
|
+
var step_execution_1 = require("./step-execution");
|
|
13
|
+
Object.defineProperty(exports, "StepExecution", { enumerable: true, get: function () { return step_execution_1.StepExecution; } });
|
|
14
|
+
Object.defineProperty(exports, "StepStatusEnum", { enumerable: true, get: function () { return step_execution_1.StepStatusEnum; } });
|
|
15
|
+
var meta_qa_1 = require("./meta-qa");
|
|
16
|
+
Object.defineProperty(exports, "applyQaAnnotation", { enumerable: true, get: function () { return meta_qa_1.applyQaAnnotation; } });
|
|
17
|
+
Object.defineProperty(exports, "applyQaAnnotations", { enumerable: true, get: function () { return meta_qa_1.applyQaAnnotations; } });
|
|
18
|
+
Object.defineProperty(exports, "createQaMetaAccumulator", { enumerable: true, get: function () { return meta_qa_1.createQaMetaAccumulator; } });
|
|
19
|
+
Object.defineProperty(exports, "qaMetaFromEntries", { enumerable: true, get: function () { return meta_qa_1.qaMetaFromEntries; } });
|
|
20
|
+
Object.defineProperty(exports, "toQaMetaWire", { enumerable: true, get: function () { return meta_qa_1.toQaMetaWire; } });
|
|
21
|
+
var ingest_payload_1 = require("./ingest-payload");
|
|
22
|
+
Object.defineProperty(exports, "buildIngestPayload", { enumerable: true, get: function () { return ingest_payload_1.buildIngestPayload; } });
|
|
23
|
+
Object.defineProperty(exports, "estimatePayloadBytes", { enumerable: true, get: function () { return ingest_payload_1.estimatePayloadBytes; } });
|
|
24
|
+
Object.defineProperty(exports, "normalizeJestReport", { enumerable: true, get: function () { return ingest_payload_1.normalizeJestReport; } });
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { JestVitestJsonReport } from './jest-vitest-report';
|
|
2
|
+
import type { CiMetadata } from '../env';
|
|
3
|
+
export type IngestFormat = 'jest-json' | 'vitest-json' | 'normalized' | 'junit-xml';
|
|
4
|
+
type IngestPayloadBase = {
|
|
5
|
+
projectKey: string;
|
|
6
|
+
launchName?: string;
|
|
7
|
+
planId?: string;
|
|
8
|
+
planKey?: string;
|
|
9
|
+
planName?: string;
|
|
10
|
+
fixVersion?: string;
|
|
11
|
+
sprintName?: string;
|
|
12
|
+
ciPlatform?: string;
|
|
13
|
+
buildUrl?: string;
|
|
14
|
+
gitCommitSha?: string;
|
|
15
|
+
gitBranch?: string;
|
|
16
|
+
gitAuthorName?: string;
|
|
17
|
+
gitAuthorEmail?: string;
|
|
18
|
+
};
|
|
19
|
+
/** FR41 JSON ingest (primary). */
|
|
20
|
+
export type JestIngestPayload = IngestPayloadBase & {
|
|
21
|
+
format?: Exclude<IngestFormat, 'junit-xml'>;
|
|
22
|
+
report: JestVitestJsonReport & {
|
|
23
|
+
testResults: NonNullable<JestVitestJsonReport['testResults']>;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/** Optional JUnit XML ingest (FR45) — server normalizes to FR41. */
|
|
27
|
+
export type JunitIngestPayload = IngestPayloadBase & {
|
|
28
|
+
format: 'junit-xml';
|
|
29
|
+
report: string;
|
|
30
|
+
junitXml?: string;
|
|
31
|
+
};
|
|
32
|
+
export type IngestPayload = JestIngestPayload | JunitIngestPayload;
|
|
33
|
+
export type BuildIngestPayloadInput = {
|
|
34
|
+
projectKey: string;
|
|
35
|
+
report: JestVitestJsonReport | string;
|
|
36
|
+
launchName?: string;
|
|
37
|
+
format?: IngestFormat;
|
|
38
|
+
planId?: string;
|
|
39
|
+
planKey?: string;
|
|
40
|
+
planName?: string;
|
|
41
|
+
fixVersion?: string;
|
|
42
|
+
sprintName?: string;
|
|
43
|
+
ci?: CiMetadata;
|
|
44
|
+
};
|
|
45
|
+
export declare function normalizeJestReport(report: JestVitestJsonReport): JestVitestJsonReport;
|
|
46
|
+
export declare function buildIngestPayload(input: BuildIngestPayloadInput & {
|
|
47
|
+
format: 'junit-xml';
|
|
48
|
+
report: string;
|
|
49
|
+
}): JunitIngestPayload;
|
|
50
|
+
export declare function buildIngestPayload(input: BuildIngestPayloadInput & {
|
|
51
|
+
format?: Exclude<IngestFormat, 'junit-xml'>;
|
|
52
|
+
report: JestVitestJsonReport;
|
|
53
|
+
}): JestIngestPayload;
|
|
54
|
+
export declare function buildIngestPayload(input: BuildIngestPayloadInput): IngestPayload;
|
|
55
|
+
export declare function estimatePayloadBytes(payload: IngestPayload): number;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeJestReport = normalizeJestReport;
|
|
4
|
+
exports.buildIngestPayload = buildIngestPayload;
|
|
5
|
+
exports.estimatePayloadBytes = estimatePayloadBytes;
|
|
6
|
+
function normalizeJestReport(report) {
|
|
7
|
+
return {
|
|
8
|
+
...report,
|
|
9
|
+
testResults: Array.isArray(report.testResults) ? report.testResults : [],
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function buildIngestPayload(input) {
|
|
13
|
+
if (!input.projectKey?.trim()) {
|
|
14
|
+
throw new Error('projectKey is required to build an ingest payload');
|
|
15
|
+
}
|
|
16
|
+
const base = {
|
|
17
|
+
projectKey: input.projectKey.trim(),
|
|
18
|
+
launchName: input.launchName,
|
|
19
|
+
planId: input.planId?.trim() || undefined,
|
|
20
|
+
planKey: input.planKey?.trim() || undefined,
|
|
21
|
+
planName: input.planName?.trim() || undefined,
|
|
22
|
+
fixVersion: input.fixVersion?.trim() || undefined,
|
|
23
|
+
sprintName: input.sprintName?.trim() || undefined,
|
|
24
|
+
ciPlatform: input.ci?.ciPlatform,
|
|
25
|
+
buildUrl: input.ci?.buildUrl,
|
|
26
|
+
gitCommitSha: input.ci?.gitCommitSha,
|
|
27
|
+
gitBranch: input.ci?.gitBranch,
|
|
28
|
+
gitAuthorName: input.ci?.gitAuthorName,
|
|
29
|
+
gitAuthorEmail: input.ci?.gitAuthorEmail,
|
|
30
|
+
};
|
|
31
|
+
if (input.format === 'junit-xml') {
|
|
32
|
+
if (typeof input.report !== 'string' || !input.report.trim()) {
|
|
33
|
+
throw new Error('junit-xml format requires report to be a non-empty XML string');
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
...base,
|
|
37
|
+
format: 'junit-xml',
|
|
38
|
+
report: input.report,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (typeof input.report === 'string') {
|
|
42
|
+
throw new Error('Jest/Vitest ingest requires a JSON report object (use --format junit-xml for XML)');
|
|
43
|
+
}
|
|
44
|
+
const normalized = normalizeJestReport(input.report);
|
|
45
|
+
return {
|
|
46
|
+
...base,
|
|
47
|
+
format: input.format ?? 'jest-json',
|
|
48
|
+
report: {
|
|
49
|
+
...normalized,
|
|
50
|
+
testResults: normalized.testResults ?? [],
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function estimatePayloadBytes(payload) {
|
|
55
|
+
return Buffer.byteLength(JSON.stringify(payload), 'utf8');
|
|
56
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Jest / Vitest JSON report (Jest-compatible shape). Mirrors Forge `domain/jest-report/types`. */
|
|
2
|
+
export interface JestVitestJsonReport {
|
|
3
|
+
numTotalTestSuites?: number;
|
|
4
|
+
numPassedTestSuites?: number;
|
|
5
|
+
numFailedTestSuites?: number;
|
|
6
|
+
numPendingTestSuites?: number;
|
|
7
|
+
numTotalTests?: number;
|
|
8
|
+
numPassedTests?: number;
|
|
9
|
+
numFailedTests?: number;
|
|
10
|
+
numPendingTests?: number;
|
|
11
|
+
numTodoTests?: number;
|
|
12
|
+
startTime?: number;
|
|
13
|
+
success?: boolean;
|
|
14
|
+
testResults?: JestTestFileResult[];
|
|
15
|
+
coverageMap?: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface JestTestFileResult {
|
|
18
|
+
name?: string;
|
|
19
|
+
status?: string;
|
|
20
|
+
message?: string;
|
|
21
|
+
startTime?: number;
|
|
22
|
+
endTime?: number;
|
|
23
|
+
assertionResults?: JestAssertionResult[];
|
|
24
|
+
}
|
|
25
|
+
export interface JestAssertionResult {
|
|
26
|
+
ancestorTitles?: string[];
|
|
27
|
+
fullName?: string;
|
|
28
|
+
title?: string;
|
|
29
|
+
status?: string;
|
|
30
|
+
duration?: number;
|
|
31
|
+
failureMessages?: string[];
|
|
32
|
+
location?: {
|
|
33
|
+
line?: number;
|
|
34
|
+
column?: number;
|
|
35
|
+
};
|
|
36
|
+
meta?: Record<string, unknown>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FR41 wire shape for `assertionResults[].meta.qa`
|
|
3
|
+
* (architecture ingest contract — simplified TestResultType serialization).
|
|
4
|
+
*/
|
|
5
|
+
export type QaMetaStepWire = {
|
|
6
|
+
id: string;
|
|
7
|
+
stepType: 'text' | 'gherkin' | 'request';
|
|
8
|
+
name: string;
|
|
9
|
+
status: 'passed' | 'failed' | 'skipped' | 'blocked';
|
|
10
|
+
};
|
|
11
|
+
export type QaMetaAttachmentWire = {
|
|
12
|
+
file_name?: string;
|
|
13
|
+
mime_type?: string;
|
|
14
|
+
size?: number;
|
|
15
|
+
/** Jira attachment id after Phase 3 Forge→Jira upload. */
|
|
16
|
+
content_ref?: string;
|
|
17
|
+
};
|
|
18
|
+
export type QaMetaFramework = 'vitest' | 'jest' | 'mocha' | 'cucumberjs' | 'cypress' | 'playwright' | 'wdio';
|
|
19
|
+
export type QaMetaWire = {
|
|
20
|
+
framework?: QaMetaFramework;
|
|
21
|
+
title?: string;
|
|
22
|
+
comment?: string;
|
|
23
|
+
fields?: Record<string, string>;
|
|
24
|
+
parameters?: Record<string, string>;
|
|
25
|
+
suite?: Array<{
|
|
26
|
+
title: string;
|
|
27
|
+
}>;
|
|
28
|
+
steps?: QaMetaStepWire[];
|
|
29
|
+
attachments?: QaMetaAttachmentWire[];
|
|
30
|
+
ignore?: boolean;
|
|
31
|
+
host?: {
|
|
32
|
+
framework?: string;
|
|
33
|
+
reporter?: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export type QaAnnotationLike = {
|
|
37
|
+
message?: string;
|
|
38
|
+
type?: string;
|
|
39
|
+
body?: unknown;
|
|
40
|
+
};
|
|
41
|
+
export type QaMetaAccumulator = {
|
|
42
|
+
title?: string;
|
|
43
|
+
comment?: string;
|
|
44
|
+
suite?: string;
|
|
45
|
+
fields?: Record<string, string>;
|
|
46
|
+
parameters?: Record<string, string>;
|
|
47
|
+
steps: Array<{
|
|
48
|
+
name: string;
|
|
49
|
+
status: QaMetaStepWire['status'];
|
|
50
|
+
}>;
|
|
51
|
+
attachments: QaMetaAttachmentWire[];
|
|
52
|
+
ignore?: boolean;
|
|
53
|
+
};
|
|
54
|
+
export declare function createQaMetaAccumulator(): QaMetaAccumulator;
|
|
55
|
+
/**
|
|
56
|
+
* Apply a Vitest/Jest QA annotation (or typed helper entry) onto an accumulator.
|
|
57
|
+
* Non-QA annotations are ignored.
|
|
58
|
+
*/
|
|
59
|
+
export declare function applyQaAnnotation(acc: QaMetaAccumulator, ann: QaAnnotationLike): void;
|
|
60
|
+
export declare function applyQaAnnotations(acc: QaMetaAccumulator, annotations: readonly QaAnnotationLike[]): void;
|
|
61
|
+
export type ToQaMetaWireOptions = {
|
|
62
|
+
framework: QaMetaFramework;
|
|
63
|
+
reporter?: string;
|
|
64
|
+
};
|
|
65
|
+
/** Returns undefined when accumulator has no QA data (omit empty meta.qa). */
|
|
66
|
+
export declare function toQaMetaWire(acc: QaMetaAccumulator, options: ToQaMetaWireOptions): QaMetaWire | undefined;
|
|
67
|
+
/** Build meta.qa from typed helper buffer entries (`{ type, body }`). */
|
|
68
|
+
export declare function qaMetaFromEntries(entries: ReadonlyArray<{
|
|
69
|
+
type: string;
|
|
70
|
+
body: unknown;
|
|
71
|
+
}>, options: ToQaMetaWireOptions): QaMetaWire | undefined;
|