allure-jasmine
Advanced tools
Comparing version 2.0.0-beta.4 to 2.0.0-beta.5
@@ -14,8 +14,9 @@ "use strict"; | ||
class JasmineAllureReporter { | ||
constructor(runtime) { | ||
this.runtime = runtime; | ||
constructor(config) { | ||
this.groupStack = []; | ||
this.labelStack = [[]]; | ||
this.runningTest = null; | ||
this.stepStack = []; | ||
this.runningExecutable = null; | ||
this.runtime = new allure_js_commons_1.AllureRuntime(config); | ||
this.installHooks(); | ||
@@ -35,7 +36,4 @@ } | ||
getInterface() { | ||
return new JasmineAllureInterface(this); | ||
return new JasmineAllureInterface(this, this.runtime); | ||
} | ||
getGlobalInfoWriter() { | ||
return this.runtime; | ||
} | ||
get currentTest() { | ||
@@ -58,2 +56,3 @@ if (this.runningTest === null) | ||
this.groupStack.push(group); | ||
this.labelStack.push([]); | ||
} | ||
@@ -83,2 +82,7 @@ specStarted(spec) { | ||
} | ||
for (const labels of this.labelStack) { | ||
for (const label of labels) { | ||
allureTest.addLabel(label.name, label.value); | ||
} | ||
} | ||
} | ||
@@ -135,5 +139,5 @@ specDone(spec) { | ||
this.groupStack.pop(); | ||
this.labelStack.pop(); | ||
} | ||
jasmineDone(runDetails) { | ||
} | ||
jasmineDone(runDetails) { } | ||
findMessageAboutThrow(expectations) { | ||
@@ -152,2 +156,7 @@ for (const e of expectations || []) { | ||
} | ||
addLabel(name, value) { | ||
if (this.labelStack.length) { | ||
this.labelStack[this.labelStack.length - 1].push({ name, value }); | ||
} | ||
} | ||
pushStep(step) { | ||
@@ -213,10 +222,16 @@ this.stepStack.push(step); | ||
class JasmineAllureInterface extends allure_js_commons_1.Allure { | ||
constructor(reporter) { | ||
super(); | ||
constructor(reporter, runtime) { | ||
super(runtime); | ||
this.reporter = reporter; | ||
} | ||
label(name, value) { | ||
try { | ||
this.reporter.currentTest.addLabel(name, value); | ||
} | ||
catch (_a) { | ||
this.reporter.addLabel(name, value); | ||
} | ||
} | ||
get currentExecutable() { | ||
return this.reporter.currentStep | ||
|| this.reporter.currentExecutable | ||
|| this.reporter.currentTest; | ||
return this.reporter.currentStep || this.reporter.currentExecutable || this.reporter.currentTest; | ||
} | ||
@@ -263,5 +278,2 @@ get currentTest() { | ||
} | ||
getGlobalInfoWriter() { | ||
return this.reporter.getGlobalInfoWriter(); | ||
} | ||
} | ||
@@ -268,0 +280,0 @@ exports.JasmineAllureInterface = JasmineAllureInterface; |
{ | ||
"name": "allure-jasmine", | ||
"version": "2.0.0-beta.4", | ||
"version": "2.0.0-beta.5", | ||
"description": "Allure Jasmine integration", | ||
@@ -9,3 +9,2 @@ "license": "Apache-2.0", | ||
"main": "./dist/index.js", | ||
"typings": "./dist/declarations/", | ||
"scripts": { | ||
@@ -19,3 +18,3 @@ "clean": "rimraf ./dist ./out", | ||
"generate-report": "allure generate ./out/allure-results -o ./out/allure-report --clean", | ||
"runTest": "nyc jasmine ./dist/test/*.test.js", | ||
"runTest": "jasmine ./dist/test/*.js", | ||
"runTestDebug": "node $NODE_DEBUG_OPTION ./node_modules/.bin/jasmine ./dist/test/*.js", | ||
@@ -29,3 +28,3 @@ "test": "rimraf ./out ; npm run runTest ; npm run generate-report" | ||
"dependencies": { | ||
"allure-js-commons": "^2.0.0-beta.4" | ||
"allure-js-commons": "^2.0.0-beta.5" | ||
}, | ||
@@ -52,3 +51,3 @@ "nyc": { | ||
}, | ||
"gitHead": "8dfa461802b3e82dcdcac7714edef9a5f810368b" | ||
"gitHead": "b76c1291b2857920d41e58974a58d92ed1922af7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
37946
375