jest-allure2-adapter
Advanced tools
Comparing version 0.0.2 to 0.0.3
/// <reference types="node" /> | ||
import { Allure, AllureGroup, AllureStep, AllureTest, Attachment, Category, ContentType, ExecutableItemWrapper, IAllureConfig, Stage, Status, StepInterface } from 'allure-js-commons'; | ||
import { Allure, AllureGroup, LinkType, AllureStep, AllureTest, Attachment, Category, ContentType, ExecutableItemWrapper, IAllureConfig, Stage, Status, StepInterface } from 'allure-js-commons'; | ||
export declare class AllureReporter extends Allure { | ||
@@ -31,2 +31,24 @@ private runningTest; | ||
stepAttachement(name: string, content: Buffer | string, type: ContentType): void; | ||
addCategory(category: Category): void; | ||
addPackage(value: string): this; | ||
description(description: string): this; | ||
descriptionHtml(description: string): this; | ||
addLink(options: { | ||
name?: string; | ||
url: string; | ||
type?: LinkType; | ||
}): this; | ||
addIssue(options: { | ||
id: string; | ||
name?: string; | ||
url?: string; | ||
}): this; | ||
addTms(options: { | ||
id: string; | ||
name?: string; | ||
url?: string; | ||
}): this; | ||
addAttachment(name: string, buffer: any, type: ContentType): this; | ||
addTestAttachment(name: string, buffer: any, type: ContentType): this; | ||
addLabel(name: string, value: string): this; | ||
} |
@@ -10,2 +10,3 @@ "use strict"; | ||
const path_1 = require("path"); | ||
const setup_1 = require("./setup"); | ||
var SpecStatus; | ||
@@ -31,2 +32,3 @@ (function (SpecStatus) { | ||
this.stepNameStack = []; | ||
// const t = new AllureRuntime(config ?? { resultsDir: 'allure-results' }); | ||
} | ||
@@ -247,3 +249,57 @@ get currentGroup() { | ||
} | ||
addCategory(category) { | ||
// todo check if the same exist | ||
setup_1.Categories.push(category); | ||
} | ||
addPackage(value) { | ||
this.currentTest.addLabel(allure_js_commons_1.LabelName.PACKAGE, value); | ||
return this; | ||
} | ||
description(description) { | ||
this.currentTest.description = description; | ||
return this; | ||
} | ||
descriptionHtml(description) { | ||
this.currentTest.descriptionHtml = description; | ||
return this; | ||
} | ||
addLink(options) { | ||
this.currentTest.addLink(options.url, options.name, options.type); | ||
return this; | ||
} | ||
addIssue(options) { | ||
var _a; | ||
const uri = 'some'; | ||
/* options.url ?? | ||
(this.config?.issueUri ? this.config.issueUri(options.id) : undefined);*/ | ||
if (!uri) { | ||
throw new Error('Specify url or issueUri in config'); | ||
} | ||
this.issue((_a = options.name) !== null && _a !== void 0 ? _a : options.id, uri); | ||
return this; | ||
} | ||
addTms(options) { | ||
var _a; | ||
const uri = 'some'; | ||
/* options.url ?? | ||
(this.config?.tmsUri ? this.config.tmsUri(options.id) : undefined);*/ | ||
if (!uri) { | ||
throw new Error('Specify url or tmsUri in config'); | ||
} | ||
this.tms((_a = options.name) !== null && _a !== void 0 ? _a : options.id, uri); | ||
return this; | ||
} | ||
addAttachment(name, buffer, type) { | ||
this.stepAttachement(name, buffer, type); | ||
return this; | ||
} | ||
addTestAttachment(name, buffer, type) { | ||
this.attachment(name, buffer, type); | ||
return this; | ||
} | ||
addLabel(name, value) { | ||
this.currentTest.addLabel(name, value); | ||
return this; | ||
} | ||
} | ||
exports.AllureReporter = AllureReporter; |
{ | ||
"name": "jest-allure2-adapter", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Allure 2 Adapter for jest", | ||
@@ -5,0 +5,0 @@ "main": "dist/index", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17184
437