allure-jasmine
Advanced tools
+86
-53
@@ -14,3 +14,3 @@ "use strict"; | ||
| var _utils = require("./utils.js"); | ||
| var _excluded = ["testMode", "resultsDir"]; | ||
| var _excluded = ["resultsDir"]; | ||
| function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
@@ -40,2 +40,5 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
| } | ||
| var { | ||
| ALLURE_TEST_MODE | ||
| } = _nodeProcess.env; | ||
| class AllureJasmineReporter { | ||
@@ -46,5 +49,5 @@ constructor(config) { | ||
| _defineProperty(this, "jasmineSuitesStack", []); | ||
| _defineProperty(this, "scopesStack", []); | ||
| var _ref = config || {}, | ||
| { | ||
| testMode, | ||
| resultsDir = "./allure-results" | ||
@@ -54,3 +57,3 @@ } = _ref, | ||
| this.allureRuntime = new _reporter.ReporterRuntime(_objectSpread(_objectSpread({}, restConfig), {}, { | ||
| writer: testMode ? new _reporter.MessageWriter() : new _reporter.FileSystemWriter({ | ||
| writer: ALLURE_TEST_MODE ? new _reporter.MessageWriter() : new _reporter.FileSystemWriter({ | ||
| resultsDir | ||
@@ -64,3 +67,4 @@ }) | ||
| // the best place to start global container for hooks and nested suites | ||
| this.allureRuntime.startScope(); | ||
| var scopeUuid = this.allureRuntime.startScope(); | ||
| this.scopesStack.push(scopeUuid); | ||
| } | ||
@@ -84,5 +88,6 @@ getCurrentSpecPath() { | ||
| handleAllureRuntimeMessages(message) { | ||
| this.allureRuntime.applyRuntimeMessages([message], { | ||
| testUuid: this.currentAllureTestUuid | ||
| }); | ||
| if (!this.currentAllureTestUuid) { | ||
| return; | ||
| } | ||
| this.allureRuntime.applyRuntimeMessages(this.currentAllureTestUuid, [message]); | ||
| } | ||
@@ -92,4 +97,3 @@ jasmineStarted() { | ||
| var globalJasmine = globalThis.jasmine; | ||
| var currentAllureResultUuidGetter = () => this.currentAllureTestUuid; | ||
| var currentAllureStepResultGetter = () => this.allureRuntime.getCurrentStep(currentAllureResultUuidGetter()); | ||
| var currentAllureStepResultGetter = () => this.currentAllureTestUuid ? this.allureRuntime.currentStep(this.currentAllureTestUuid) : undefined; | ||
| // @ts-ignore | ||
@@ -102,7 +106,8 @@ var originalExpectationHandler = globalJasmine.Spec.prototype.addExpectationResult; | ||
| var isStepFailed = !passed && !isError; | ||
| if (currentAllureStepResultGetter() && isStepFailed) { | ||
| allureRuntime.updateStep(result => { | ||
| var stepUuid = currentAllureStepResultGetter(); | ||
| if (stepUuid && isStepFailed) { | ||
| allureRuntime.updateStep(stepUuid, result => { | ||
| result.status = _allureJsCommons.Status.FAILED; | ||
| result.stage = _allureJsCommons.Stage.FINISHED; | ||
| }, currentAllureResultUuidGetter()); | ||
| }); | ||
| } | ||
@@ -114,7 +119,11 @@ originalExpectationHandler.call(this, passed, data, isError); | ||
| this.jasmineSuitesStack.push(suite); | ||
| this.allureRuntime.startScope(); | ||
| var scopeUuid = this.allureRuntime.startScope(); | ||
| this.scopesStack.push(scopeUuid); | ||
| } | ||
| suiteDone() { | ||
| this.jasmineSuitesStack.pop(); | ||
| this.allureRuntime.writeScope(); | ||
| var scopeUuid = this.scopesStack.pop(); | ||
| if (scopeUuid) { | ||
| this.allureRuntime.writeScope(scopeUuid); | ||
| } | ||
| } | ||
@@ -126,8 +135,11 @@ specStarted(spec) { | ||
| stage: _allureJsCommons.Stage.RUNNING | ||
| }); | ||
| }, this.scopesStack); | ||
| } | ||
| specDone(spec) { | ||
| if (!this.currentAllureTestUuid) { | ||
| return; | ||
| } | ||
| var specPath = this.getCurrentSpecPath(); | ||
| var exceptionInfo = (0, _utils.findMessageAboutThrow)(spec.failedExpectations) || (0, _utils.findAnyError)(spec.failedExpectations); | ||
| this.allureRuntime.updateTest(result => { | ||
| this.allureRuntime.updateTest(this.currentAllureTestUuid, result => { | ||
| var suitesLabels = (0, _reporter.getSuiteLabels)(specPath); | ||
@@ -161,6 +173,4 @@ result.labels.push(...suitesLabels); | ||
| } | ||
| }, this.currentAllureTestUuid); | ||
| this.allureRuntime.stopTest({ | ||
| uuid: this.currentAllureTestUuid | ||
| }); | ||
| this.allureRuntime.stopTest(this.currentAllureTestUuid); | ||
| this.allureRuntime.writeTest(this.currentAllureTestUuid); | ||
@@ -172,4 +182,7 @@ this.currentAllureTestUuid = undefined; | ||
| this.allureRuntime.writeCategoriesDefinitions(); | ||
| // write global container | ||
| this.allureRuntime.writeScope(); | ||
| // write global container (or any remaining scopes) | ||
| this.scopesStack.forEach(scopeUuid => { | ||
| this.allureRuntime.writeScope(scopeUuid); | ||
| }); | ||
| this.scopesStack = []; | ||
| } | ||
@@ -200,18 +213,28 @@ installHooks() { | ||
| done(); | ||
| this.allureRuntime.startFixture(fixtureType, { | ||
| name: fixtureName, | ||
| stage: _allureJsCommons.Stage.FINISHED, | ||
| status: _allureJsCommons.Status.PASSED, | ||
| start | ||
| }); | ||
| this.allureRuntime.stopFixture(); | ||
| var scopeUuid = this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined; | ||
| if (scopeUuid) { | ||
| var fixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, { | ||
| name: fixtureName, | ||
| stage: _allureJsCommons.Stage.FINISHED, | ||
| status: _allureJsCommons.Status.PASSED, | ||
| start | ||
| }); | ||
| if (fixtureUuid) { | ||
| this.allureRuntime.stopFixture(fixtureUuid); | ||
| } | ||
| } | ||
| }).catch(err => { | ||
| done.fail(err); | ||
| this.allureRuntime.startFixture(fixtureType, { | ||
| name: fixtureName, | ||
| stage: _allureJsCommons.Stage.FINISHED, | ||
| status: _allureJsCommons.Status.BROKEN, | ||
| start | ||
| }); | ||
| this.allureRuntime.stopFixture(); | ||
| var scopeUuid = this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined; | ||
| if (scopeUuid) { | ||
| var fixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, { | ||
| name: fixtureName, | ||
| stage: _allureJsCommons.Stage.FINISHED, | ||
| status: _allureJsCommons.Status.BROKEN, | ||
| start | ||
| }); | ||
| if (fixtureUuid) { | ||
| this.allureRuntime.stopFixture(fixtureUuid); | ||
| } | ||
| } | ||
| }); | ||
@@ -221,9 +244,14 @@ } else { | ||
| done(); | ||
| this.allureRuntime.startFixture(fixtureType, { | ||
| name: fixtureName, | ||
| stage: _allureJsCommons.Stage.FINISHED, | ||
| status: _allureJsCommons.Status.PASSED, | ||
| start | ||
| }); | ||
| this.allureRuntime.stopFixture(); | ||
| var scopeUuid = this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined; | ||
| if (scopeUuid) { | ||
| var fixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, { | ||
| name: fixtureName, | ||
| stage: _allureJsCommons.Stage.FINISHED, | ||
| status: _allureJsCommons.Status.PASSED, | ||
| start | ||
| }); | ||
| if (fixtureUuid) { | ||
| this.allureRuntime.stopFixture(fixtureUuid); | ||
| } | ||
| } | ||
| } catch (err) { | ||
@@ -234,13 +262,18 @@ var { | ||
| } = err; | ||
| this.allureRuntime.startFixture(fixtureType, { | ||
| name: fixtureName, | ||
| stage: _allureJsCommons.Stage.FINISHED, | ||
| status: _allureJsCommons.Status.BROKEN, | ||
| statusDetails: { | ||
| message, | ||
| trace: stack | ||
| }, | ||
| start | ||
| }); | ||
| this.allureRuntime.stopFixture(); | ||
| var _scopeUuid = this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined; | ||
| if (_scopeUuid) { | ||
| var _fixtureUuid = this.allureRuntime.startFixture(_scopeUuid, fixtureType, { | ||
| name: fixtureName, | ||
| stage: _allureJsCommons.Stage.FINISHED, | ||
| status: _allureJsCommons.Status.BROKEN, | ||
| statusDetails: { | ||
| message, | ||
| trace: stack | ||
| }, | ||
| start | ||
| }); | ||
| if (_fixtureUuid) { | ||
| this.allureRuntime.stopFixture(_fixtureUuid); | ||
| } | ||
| } | ||
| throw err; | ||
@@ -247,0 +280,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","names":["_nodeProcess","require","_allureJsCommons","_interopRequireWildcard","allure","_sdk","_reporter","_runtime","_utils","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_objectWithoutProperties","_objectWithoutPropertiesLoose","indexOf","propertyIsEnumerable","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","asyncGeneratorStep","c","done","Promise","resolve","then","_asyncToGenerator","_next","_throw","AllureJasmineTestRuntime","MessageTestRuntime","constructor","allureJasmineReporter","sendMessage","message","_this","handleAllureRuntimeMessages","AllureJasmineReporter","config","_ref","testMode","resultsDir","restConfig","allureRuntime","ReporterRuntime","writer","MessageWriter","FileSystemWriter","testRuntime","setGlobalTestRuntime","installHooks","startScope","getCurrentSpecPath","path","jasmineSuitesStack","map","suite","fullName","Boolean","reduce","_ref2","currentPath","acc","lastPath","newSpecPath","concat","replace","trim","getSpecFullName","spec","specFilename","filename","cwd","specPath","description","join","getAllureInterface","applyRuntimeMessages","testUuid","currentAllureTestUuid","jasmineStarted","globalJasmine","globalThis","jasmine","currentAllureResultUuidGetter","currentAllureStepResultGetter","getCurrentStep","originalExpectationHandler","Spec","prototype","addExpectationResult","passed","data","isError","isStepFailed","updateStep","result","status","Status","FAILED","stage","Stage","FINISHED","suiteStarted","suiteDone","pop","writeScope","specStarted","startTest","name","RUNNING","specDone","exceptionInfo","findMessageAboutThrow","failedExpectations","findAnyError","updateTest","suitesLabels","getSuiteLabels","labels","SKIPPED","PENDING","statusDetails","pendingReason","PASSED","trace","stack","matcherName","BROKEN","stopTest","uuid","writeTest","undefined","jasmineDone","writeEnvironmentInfo","writeCategoriesDefinitions","jasmineBeforeAll","global","beforeAll","jasmineAfterAll","afterAll","jasmineBeforeEach","beforeEach","jasmineAfterEach","afterEach","wrapJasmineHook","original","fixtureType","fixtureName","action","timeout","start","Date","now","ret","reject","fail","isPromise","startFixture","stopFixture","catch","err","exports","module"],"sources":["../../src/index.ts"],"sourcesContent":["import { cwd } from \"node:process\";\nimport * as allure from \"allure-js-commons\";\nimport { Stage, Status } from \"allure-js-commons\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport { isPromise } from \"allure-js-commons/sdk\";\nimport type { FixtureType } from \"allure-js-commons/sdk/reporter\";\nimport { FileSystemWriter, MessageWriter, ReporterRuntime, getSuiteLabels } from \"allure-js-commons/sdk/reporter\";\nimport { MessageTestRuntime, setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport type { AllureJasmineConfig, JasmineBeforeAfterFn } from \"./model.js\";\nimport { findAnyError, findMessageAboutThrow } from \"./utils.js\";\n\nclass AllureJasmineTestRuntime extends MessageTestRuntime {\n constructor(private readonly allureJasmineReporter: AllureJasmineReporter) {\n super();\n }\n\n async sendMessage(message: RuntimeMessage) {\n this.allureJasmineReporter.handleAllureRuntimeMessages(message);\n await Promise.resolve();\n }\n}\n\nexport default class AllureJasmineReporter implements jasmine.CustomReporter {\n private readonly allureRuntime: ReporterRuntime;\n private currentAllureTestUuid?: string;\n private jasmineSuitesStack: jasmine.SuiteResult[] = [];\n\n constructor(config: AllureJasmineConfig) {\n const { testMode, resultsDir = \"./allure-results\", ...restConfig } = config || {};\n\n this.allureRuntime = new ReporterRuntime({\n ...restConfig,\n writer: testMode\n ? new MessageWriter()\n : new FileSystemWriter({\n resultsDir,\n }),\n });\n\n const testRuntime = new AllureJasmineTestRuntime(this);\n\n setGlobalTestRuntime(testRuntime);\n\n this.installHooks();\n\n // the best place to start global container for hooks and nested suites\n this.allureRuntime.startScope();\n }\n\n private getCurrentSpecPath() {\n const path = this.jasmineSuitesStack.map((suite) => suite?.fullName).filter(Boolean);\n\n return path.filter(Boolean).reduce(\n ([acc, lastPath], currentPath) => {\n const newSpecPath = acc.concat(currentPath.replace(lastPath as string, \"\").trim());\n\n return [newSpecPath, currentPath];\n },\n [[] as string[], \"\"],\n )[0] as string[];\n }\n\n private getSpecFullName(spec: jasmine.SpecResult & { filename?: string }) {\n const specFilename = (spec.filename || \"\").replace(cwd(), \"\").replace(/^[/\\\\]/, \"\");\n const specPath = this.getCurrentSpecPath().concat(spec.description).join(\" > \");\n\n return `${specFilename}#${specPath}`;\n }\n\n getAllureInterface() {\n return allure;\n }\n\n handleAllureRuntimeMessages(message: RuntimeMessage) {\n this.allureRuntime.applyRuntimeMessages([message], { testUuid: this.currentAllureTestUuid! });\n }\n\n jasmineStarted(): void {\n const allureRuntime = this.allureRuntime;\n const globalJasmine = globalThis.jasmine;\n const currentAllureResultUuidGetter = () => this.currentAllureTestUuid;\n const currentAllureStepResultGetter = () => this.allureRuntime.getCurrentStep(currentAllureResultUuidGetter()!);\n // @ts-ignore\n const originalExpectationHandler = globalJasmine.Spec.prototype.addExpectationResult;\n\n // soft-asserts support (when failed assertions don't throw errors)\n // @ts-ignore\n globalJasmine.Spec.prototype.addExpectationResult = function (passed, data, isError) {\n const isStepFailed = !passed && !isError;\n\n if (currentAllureStepResultGetter() && isStepFailed) {\n allureRuntime.updateStep((result) => {\n result.status = Status.FAILED;\n result.stage = Stage.FINISHED;\n }, currentAllureResultUuidGetter()!);\n }\n\n originalExpectationHandler.call(this, passed, data, isError);\n };\n }\n\n suiteStarted(suite: jasmine.SuiteResult): void {\n this.jasmineSuitesStack.push(suite);\n this.allureRuntime.startScope();\n }\n\n suiteDone(): void {\n this.jasmineSuitesStack.pop();\n this.allureRuntime.writeScope();\n }\n\n specStarted(spec: jasmine.SpecResult): void {\n this.currentAllureTestUuid = this.allureRuntime.startTest({\n name: spec.description,\n fullName: this.getSpecFullName(spec),\n stage: Stage.RUNNING,\n });\n }\n\n specDone(spec: jasmine.SpecResult): void {\n const specPath = this.getCurrentSpecPath();\n const exceptionInfo = findMessageAboutThrow(spec.failedExpectations) || findAnyError(spec.failedExpectations);\n\n this.allureRuntime.updateTest((result) => {\n const suitesLabels = getSuiteLabels(specPath);\n\n result.labels.push(...suitesLabels);\n\n if (spec.status === \"pending\" || spec.status === \"disabled\" || spec.status === \"excluded\") {\n result.status = Status.SKIPPED;\n result.stage = Stage.PENDING;\n result.statusDetails = {\n message: spec.pendingReason || \"Suite disabled\",\n };\n return;\n }\n\n result.stage = Stage.FINISHED;\n\n if (spec.status === \"passed\") {\n result.status = Status.PASSED;\n return;\n }\n\n if (exceptionInfo) {\n result.statusDetails = {\n message: exceptionInfo.message,\n trace: exceptionInfo.stack,\n };\n }\n\n if (spec.status === \"failed\" && exceptionInfo?.matcherName) {\n result.status = Status.FAILED;\n return;\n } else {\n result.status = Status.BROKEN;\n return;\n }\n }, this.currentAllureTestUuid!);\n this.allureRuntime.stopTest({ uuid: this.currentAllureTestUuid! });\n this.allureRuntime.writeTest(this.currentAllureTestUuid!);\n this.currentAllureTestUuid = undefined;\n }\n\n jasmineDone(): void {\n this.allureRuntime.writeEnvironmentInfo();\n this.allureRuntime.writeCategoriesDefinitions();\n // write global container\n this.allureRuntime.writeScope();\n }\n\n private installHooks(): void {\n const jasmineBeforeAll: JasmineBeforeAfterFn = global.beforeAll;\n const jasmineAfterAll: JasmineBeforeAfterFn = global.afterAll;\n const jasmineBeforeEach: JasmineBeforeAfterFn = global.beforeEach;\n const jasmineAfterEach: JasmineBeforeAfterFn = global.afterEach;\n const wrapJasmineHook = (original: JasmineBeforeAfterFn, fixtureType: FixtureType, fixtureName: string) => {\n return (action: (done: DoneFn) => void, timeout?: number): void => {\n original((done) => {\n const start = Date.now();\n let ret;\n\n if (action.length > 0) {\n // function takes done callback\n ret = new Promise((resolve, reject) => {\n const t: any = resolve;\n\n t.fail = reject;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n action(t);\n });\n } else {\n ret = action(done);\n }\n\n if (isPromise(ret)) {\n (ret as Promise<any>)\n .then(() => {\n done();\n\n this.allureRuntime.startFixture(fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.PASSED,\n start,\n });\n this.allureRuntime.stopFixture();\n })\n .catch((err) => {\n done.fail(err as Error);\n\n this.allureRuntime.startFixture(fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.BROKEN,\n start,\n });\n this.allureRuntime.stopFixture();\n });\n } else {\n try {\n done();\n\n this.allureRuntime.startFixture(fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.PASSED,\n start,\n });\n this.allureRuntime.stopFixture();\n } catch (err) {\n const { message, stack } = err as Error;\n\n this.allureRuntime.startFixture(fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.BROKEN,\n statusDetails: {\n message,\n trace: stack,\n },\n start,\n });\n this.allureRuntime.stopFixture();\n\n throw err;\n }\n }\n }, timeout);\n };\n };\n\n global.beforeAll = wrapJasmineHook(jasmineBeforeAll, \"before\", \"beforeAll\");\n global.beforeEach = wrapJasmineHook(jasmineBeforeEach, \"before\", \"beforeEach\");\n global.afterAll = wrapJasmineHook(jasmineAfterAll, \"after\", \"afterAll\");\n global.afterEach = wrapJasmineHook(jasmineAfterEach, \"after\", \"afterEach\");\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA4C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2F,KAAK,EAAEC;gBACT,CAAC;gBACDyB;cACF,CAAC,CAAC;cACF,IAAI,CAAC5G,aAAa,CAACoH,WAAW,CAAC,CAAC;cAEhC,MAAME,GAAG;YACX;UACF;QACF,CAAC,EAAEX,OAAO,CAAC;MACb,CAAC;IACH,CAAC;IAEDb,MAAM,CAACC,SAAS,GAAGO,eAAe,CAACT,gBAAgB,EAAE,QAAQ,EAAE,WAAW,CAAC;IAC3EC,MAAM,CAACK,UAAU,GAAGG,eAAe,CAACJ,iBAAiB,EAAE,QAAQ,EAAE,YAAY,CAAC;IAC9EJ,MAAM,CAACG,QAAQ,GAAGK,eAAe,CAACN,eAAe,EAAE,OAAO,EAAE,UAAU,CAAC;IACvEF,MAAM,CAACO,SAAS,GAAGC,eAAe,CAACF,gBAAgB,EAAE,OAAO,EAAE,WAAW,CAAC;EAC5E;AACF;AAACmB,OAAA,CAAAzL,OAAA,GAAA4D,qBAAA;AAAA8H,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAzL,OAAA","ignoreList":[]} | ||
| {"version":3,"file":"index.js","names":["_nodeProcess","require","_allureJsCommons","_interopRequireWildcard","allure","_sdk","_reporter","_runtime","_utils","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_objectWithoutProperties","_objectWithoutPropertiesLoose","indexOf","propertyIsEnumerable","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","asyncGeneratorStep","c","done","Promise","resolve","then","_asyncToGenerator","_next","_throw","AllureJasmineTestRuntime","MessageTestRuntime","constructor","allureJasmineReporter","sendMessage","message","_this","handleAllureRuntimeMessages","ALLURE_TEST_MODE","env","AllureJasmineReporter","config","_ref","resultsDir","restConfig","allureRuntime","ReporterRuntime","writer","MessageWriter","FileSystemWriter","testRuntime","setGlobalTestRuntime","installHooks","scopeUuid","startScope","scopesStack","getCurrentSpecPath","path","jasmineSuitesStack","map","suite","fullName","Boolean","reduce","_ref2","currentPath","acc","lastPath","newSpecPath","concat","replace","trim","getSpecFullName","spec","specFilename","filename","cwd","specPath","description","join","getAllureInterface","currentAllureTestUuid","applyRuntimeMessages","jasmineStarted","globalJasmine","globalThis","jasmine","currentAllureStepResultGetter","currentStep","undefined","originalExpectationHandler","Spec","prototype","addExpectationResult","passed","data","isError","isStepFailed","stepUuid","updateStep","result","status","Status","FAILED","stage","Stage","FINISHED","suiteStarted","suiteDone","pop","writeScope","specStarted","startTest","name","RUNNING","specDone","exceptionInfo","findMessageAboutThrow","failedExpectations","findAnyError","updateTest","suitesLabels","getSuiteLabels","labels","SKIPPED","PENDING","statusDetails","pendingReason","PASSED","trace","stack","matcherName","BROKEN","stopTest","writeTest","jasmineDone","writeEnvironmentInfo","writeCategoriesDefinitions","jasmineBeforeAll","global","beforeAll","jasmineAfterAll","afterAll","jasmineBeforeEach","beforeEach","jasmineAfterEach","afterEach","wrapJasmineHook","original","fixtureType","fixtureName","action","timeout","start","Date","now","ret","reject","fail","isPromise","fixtureUuid","startFixture","stopFixture","catch","err","exports","module"],"sources":["../../src/index.ts"],"sourcesContent":["import { cwd, env } from \"node:process\";\nimport * as allure from \"allure-js-commons\";\nimport { Stage, Status } from \"allure-js-commons\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport { isPromise } from \"allure-js-commons/sdk\";\nimport type { Config, FixtureType } from \"allure-js-commons/sdk/reporter\";\nimport { FileSystemWriter, MessageWriter, ReporterRuntime, getSuiteLabels } from \"allure-js-commons/sdk/reporter\";\nimport { MessageTestRuntime, setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport type { JasmineBeforeAfterFn } from \"./model.js\";\nimport { findAnyError, findMessageAboutThrow } from \"./utils.js\";\n\nclass AllureJasmineTestRuntime extends MessageTestRuntime {\n constructor(private readonly allureJasmineReporter: AllureJasmineReporter) {\n super();\n }\n\n async sendMessage(message: RuntimeMessage) {\n this.allureJasmineReporter.handleAllureRuntimeMessages(message);\n await Promise.resolve();\n }\n}\n\nconst { ALLURE_TEST_MODE } = env;\n\nexport default class AllureJasmineReporter implements jasmine.CustomReporter {\n private readonly allureRuntime: ReporterRuntime;\n private currentAllureTestUuid?: string;\n private jasmineSuitesStack: jasmine.SuiteResult[] = [];\n private scopesStack: string[] = [];\n\n constructor(config: Config) {\n const { resultsDir = \"./allure-results\", ...restConfig } = config || {};\n\n this.allureRuntime = new ReporterRuntime({\n ...restConfig,\n writer: ALLURE_TEST_MODE\n ? new MessageWriter()\n : new FileSystemWriter({\n resultsDir,\n }),\n });\n\n const testRuntime = new AllureJasmineTestRuntime(this);\n\n setGlobalTestRuntime(testRuntime);\n\n this.installHooks();\n\n // the best place to start global container for hooks and nested suites\n const scopeUuid = this.allureRuntime.startScope();\n this.scopesStack.push(scopeUuid);\n }\n\n private getCurrentSpecPath() {\n const path = this.jasmineSuitesStack.map((suite) => suite?.fullName).filter(Boolean);\n\n return path.filter(Boolean).reduce(\n ([acc, lastPath], currentPath) => {\n const newSpecPath = acc.concat(currentPath.replace(lastPath as string, \"\").trim());\n\n return [newSpecPath, currentPath];\n },\n [[] as string[], \"\"],\n )[0] as string[];\n }\n\n private getSpecFullName(spec: jasmine.SpecResult & { filename?: string }) {\n const specFilename = (spec.filename || \"\").replace(cwd(), \"\").replace(/^[/\\\\]/, \"\");\n const specPath = this.getCurrentSpecPath().concat(spec.description).join(\" > \");\n\n return `${specFilename}#${specPath}`;\n }\n\n getAllureInterface() {\n return allure;\n }\n\n handleAllureRuntimeMessages(message: RuntimeMessage) {\n if (!this.currentAllureTestUuid) {\n return;\n }\n this.allureRuntime.applyRuntimeMessages(this.currentAllureTestUuid, [message]);\n }\n\n jasmineStarted(): void {\n const allureRuntime = this.allureRuntime;\n const globalJasmine = globalThis.jasmine;\n const currentAllureStepResultGetter = () =>\n this.currentAllureTestUuid ? this.allureRuntime.currentStep(this.currentAllureTestUuid) : undefined;\n // @ts-ignore\n const originalExpectationHandler = globalJasmine.Spec.prototype.addExpectationResult;\n\n // soft-asserts support (when failed assertions don't throw errors)\n // @ts-ignore\n globalJasmine.Spec.prototype.addExpectationResult = function (passed, data, isError) {\n const isStepFailed = !passed && !isError;\n\n const stepUuid = currentAllureStepResultGetter();\n if (stepUuid && isStepFailed) {\n allureRuntime.updateStep(stepUuid, (result) => {\n result.status = Status.FAILED;\n result.stage = Stage.FINISHED;\n });\n }\n\n originalExpectationHandler.call(this, passed, data, isError);\n };\n }\n\n suiteStarted(suite: jasmine.SuiteResult): void {\n this.jasmineSuitesStack.push(suite);\n const scopeUuid = this.allureRuntime.startScope();\n this.scopesStack.push(scopeUuid);\n }\n\n suiteDone(): void {\n this.jasmineSuitesStack.pop();\n const scopeUuid = this.scopesStack.pop();\n if (scopeUuid) {\n this.allureRuntime.writeScope(scopeUuid);\n }\n }\n\n specStarted(spec: jasmine.SpecResult): void {\n this.currentAllureTestUuid = this.allureRuntime.startTest(\n {\n name: spec.description,\n fullName: this.getSpecFullName(spec),\n stage: Stage.RUNNING,\n },\n this.scopesStack,\n );\n }\n\n specDone(spec: jasmine.SpecResult): void {\n if (!this.currentAllureTestUuid) {\n return;\n }\n const specPath = this.getCurrentSpecPath();\n const exceptionInfo = findMessageAboutThrow(spec.failedExpectations) || findAnyError(spec.failedExpectations);\n\n this.allureRuntime.updateTest(this.currentAllureTestUuid, (result) => {\n const suitesLabels = getSuiteLabels(specPath);\n\n result.labels.push(...suitesLabels);\n\n if (spec.status === \"pending\" || spec.status === \"disabled\" || spec.status === \"excluded\") {\n result.status = Status.SKIPPED;\n result.stage = Stage.PENDING;\n result.statusDetails = {\n message: spec.pendingReason || \"Suite disabled\",\n };\n return;\n }\n\n result.stage = Stage.FINISHED;\n\n if (spec.status === \"passed\") {\n result.status = Status.PASSED;\n return;\n }\n\n if (exceptionInfo) {\n result.statusDetails = {\n message: exceptionInfo.message,\n trace: exceptionInfo.stack,\n };\n }\n\n if (spec.status === \"failed\" && exceptionInfo?.matcherName) {\n result.status = Status.FAILED;\n return;\n } else {\n result.status = Status.BROKEN;\n return;\n }\n });\n this.allureRuntime.stopTest(this.currentAllureTestUuid);\n this.allureRuntime.writeTest(this.currentAllureTestUuid);\n this.currentAllureTestUuid = undefined;\n }\n\n jasmineDone(): void {\n this.allureRuntime.writeEnvironmentInfo();\n this.allureRuntime.writeCategoriesDefinitions();\n // write global container (or any remaining scopes)\n this.scopesStack.forEach((scopeUuid) => {\n this.allureRuntime.writeScope(scopeUuid);\n });\n this.scopesStack = [];\n }\n\n private installHooks(): void {\n const jasmineBeforeAll: JasmineBeforeAfterFn = global.beforeAll;\n const jasmineAfterAll: JasmineBeforeAfterFn = global.afterAll;\n const jasmineBeforeEach: JasmineBeforeAfterFn = global.beforeEach;\n const jasmineAfterEach: JasmineBeforeAfterFn = global.afterEach;\n const wrapJasmineHook = (original: JasmineBeforeAfterFn, fixtureType: FixtureType, fixtureName: string) => {\n return (action: (done: DoneFn) => void, timeout?: number): void => {\n original((done) => {\n const start = Date.now();\n let ret;\n\n if (action.length > 0) {\n // function takes done callback\n ret = new Promise((resolve, reject) => {\n const t: any = resolve;\n\n t.fail = reject;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n action(t);\n });\n } else {\n ret = action(done);\n }\n\n if (isPromise(ret)) {\n (ret as Promise<any>)\n .then(() => {\n done();\n\n const scopeUuid =\n this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined;\n if (scopeUuid) {\n const fixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.PASSED,\n start,\n });\n if (fixtureUuid) {\n this.allureRuntime.stopFixture(fixtureUuid);\n }\n }\n })\n .catch((err) => {\n done.fail(err as Error);\n const scopeUuid =\n this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined;\n if (scopeUuid) {\n const fixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.BROKEN,\n start,\n });\n if (fixtureUuid) {\n this.allureRuntime.stopFixture(fixtureUuid);\n }\n }\n });\n } else {\n try {\n done();\n const scopeUuid = this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined;\n if (scopeUuid) {\n const fixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.PASSED,\n start,\n });\n if (fixtureUuid) {\n this.allureRuntime.stopFixture(fixtureUuid);\n }\n }\n } catch (err) {\n const { message, stack } = err as Error;\n const scopeUuid = this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined;\n if (scopeUuid) {\n const fixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.BROKEN,\n statusDetails: {\n message,\n trace: stack,\n },\n start,\n });\n if (fixtureUuid) {\n this.allureRuntime.stopFixture(fixtureUuid);\n }\n }\n\n throw err;\n }\n }\n }, timeout);\n };\n };\n\n global.beforeAll = wrapJasmineHook(jasmineBeforeAll, \"before\", \"beforeAll\");\n global.beforeEach = wrapJasmineHook(jasmineBeforeEach, \"before\", \"beforeEach\");\n global.afterAll = wrapJasmineHook(jasmineAfterAll, \"after\", \"afterAll\");\n global.afterEach = wrapJasmineHook(jasmineAfterEach, \"after\", \"afterEach\");\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA4C,IAAAG,MAAA,GAAAF,gBAAA;AAG5C,IAAAG,IAAA,GAAAJ,OAAA;AAEA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAEA,IAAAO,M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UAAS,EAAEgG,WAAW,EAAE;kBAC1EpC,IAAI,EAAEqC,WAAW;kBACjB9C,KAAK,EAAEC,sBAAK,CAACC,QAAQ;kBACrBL,MAAM,EAAEC,uBAAM,CAAC8B,MAAM;kBACrBN,aAAa,EAAE;oBACb3F,OAAO;oBACP8F,KAAK,EAAEC;kBACT,CAAC;kBACDuB;gBACF,CAAC,CAAC;gBACF,IAAIO,YAAW,EAAE;kBACf,IAAI,CAACnH,aAAa,CAACqH,WAAW,CAACF,YAAW,CAAC;gBAC7C;cACF;cAEA,MAAMI,GAAG;YACX;UACF;QACF,CAAC,EAAEZ,OAAO,CAAC;MACb,CAAC;IACH,CAAC;IAEDb,MAAM,CAACC,SAAS,GAAGO,eAAe,CAACT,gBAAgB,EAAE,QAAQ,EAAE,WAAW,CAAC;IAC3EC,MAAM,CAACK,UAAU,GAAGG,eAAe,CAACJ,iBAAiB,EAAE,QAAQ,EAAE,YAAY,CAAC;IAC9EJ,MAAM,CAACG,QAAQ,GAAGK,eAAe,CAACN,eAAe,EAAE,OAAO,EAAE,UAAU,CAAC;IACvEF,MAAM,CAACO,SAAS,GAAGC,eAAe,CAACF,gBAAgB,EAAE,OAAO,EAAE,WAAW,CAAC;EAC5E;AACF;AAACoB,OAAA,CAAA3L,OAAA,GAAA8D,qBAAA;AAAA8H,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA3L,OAAA","ignoreList":[]} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"model.js","names":[],"sources":["../../src/model.ts"],"sourcesContent":["import type { Config } from \"allure-js-commons/sdk/reporter\";\n\nexport interface AllureJasmineConfig extends Config {\n testMode?: boolean;\n}\n\nexport type JasmineBeforeAfterFn = (action: (done: DoneFn) => void, timeout?: number) => void;\n"],"mappings":"","ignoreList":[]} | ||
| {"version":3,"file":"model.js","names":[],"sources":["../../src/model.ts"],"sourcesContent":["export type JasmineBeforeAfterFn = (action: (done: DoneFn) => void, timeout?: number) => void;\n"],"mappings":"","ignoreList":[]} |
+87
-54
@@ -1,2 +0,2 @@ | ||
| var _excluded = ["testMode", "resultsDir"]; | ||
| var _excluded = ["resultsDir"]; | ||
| function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
@@ -11,3 +11,3 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
| function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } | ||
| import { cwd } from "node:process"; | ||
| import { cwd, env } from "node:process"; | ||
| import * as allure from "allure-js-commons"; | ||
@@ -32,2 +32,5 @@ import { Stage, Status } from "allure-js-commons"; | ||
| } | ||
| var { | ||
| ALLURE_TEST_MODE | ||
| } = env; | ||
| export default class AllureJasmineReporter { | ||
@@ -38,5 +41,5 @@ constructor(config) { | ||
| _defineProperty(this, "jasmineSuitesStack", []); | ||
| _defineProperty(this, "scopesStack", []); | ||
| var _ref = config || {}, | ||
| { | ||
| testMode, | ||
| resultsDir = "./allure-results" | ||
@@ -46,3 +49,3 @@ } = _ref, | ||
| this.allureRuntime = new ReporterRuntime(_objectSpread(_objectSpread({}, restConfig), {}, { | ||
| writer: testMode ? new MessageWriter() : new FileSystemWriter({ | ||
| writer: ALLURE_TEST_MODE ? new MessageWriter() : new FileSystemWriter({ | ||
| resultsDir | ||
@@ -56,3 +59,4 @@ }) | ||
| // the best place to start global container for hooks and nested suites | ||
| this.allureRuntime.startScope(); | ||
| var scopeUuid = this.allureRuntime.startScope(); | ||
| this.scopesStack.push(scopeUuid); | ||
| } | ||
@@ -76,5 +80,6 @@ getCurrentSpecPath() { | ||
| handleAllureRuntimeMessages(message) { | ||
| this.allureRuntime.applyRuntimeMessages([message], { | ||
| testUuid: this.currentAllureTestUuid | ||
| }); | ||
| if (!this.currentAllureTestUuid) { | ||
| return; | ||
| } | ||
| this.allureRuntime.applyRuntimeMessages(this.currentAllureTestUuid, [message]); | ||
| } | ||
@@ -84,4 +89,3 @@ jasmineStarted() { | ||
| var globalJasmine = globalThis.jasmine; | ||
| var currentAllureResultUuidGetter = () => this.currentAllureTestUuid; | ||
| var currentAllureStepResultGetter = () => this.allureRuntime.getCurrentStep(currentAllureResultUuidGetter()); | ||
| var currentAllureStepResultGetter = () => this.currentAllureTestUuid ? this.allureRuntime.currentStep(this.currentAllureTestUuid) : undefined; | ||
| // @ts-ignore | ||
@@ -94,7 +98,8 @@ var originalExpectationHandler = globalJasmine.Spec.prototype.addExpectationResult; | ||
| var isStepFailed = !passed && !isError; | ||
| if (currentAllureStepResultGetter() && isStepFailed) { | ||
| allureRuntime.updateStep(result => { | ||
| var stepUuid = currentAllureStepResultGetter(); | ||
| if (stepUuid && isStepFailed) { | ||
| allureRuntime.updateStep(stepUuid, result => { | ||
| result.status = Status.FAILED; | ||
| result.stage = Stage.FINISHED; | ||
| }, currentAllureResultUuidGetter()); | ||
| }); | ||
| } | ||
@@ -106,7 +111,11 @@ originalExpectationHandler.call(this, passed, data, isError); | ||
| this.jasmineSuitesStack.push(suite); | ||
| this.allureRuntime.startScope(); | ||
| var scopeUuid = this.allureRuntime.startScope(); | ||
| this.scopesStack.push(scopeUuid); | ||
| } | ||
| suiteDone() { | ||
| this.jasmineSuitesStack.pop(); | ||
| this.allureRuntime.writeScope(); | ||
| var scopeUuid = this.scopesStack.pop(); | ||
| if (scopeUuid) { | ||
| this.allureRuntime.writeScope(scopeUuid); | ||
| } | ||
| } | ||
@@ -118,8 +127,11 @@ specStarted(spec) { | ||
| stage: Stage.RUNNING | ||
| }); | ||
| }, this.scopesStack); | ||
| } | ||
| specDone(spec) { | ||
| if (!this.currentAllureTestUuid) { | ||
| return; | ||
| } | ||
| var specPath = this.getCurrentSpecPath(); | ||
| var exceptionInfo = findMessageAboutThrow(spec.failedExpectations) || findAnyError(spec.failedExpectations); | ||
| this.allureRuntime.updateTest(result => { | ||
| this.allureRuntime.updateTest(this.currentAllureTestUuid, result => { | ||
| var suitesLabels = getSuiteLabels(specPath); | ||
@@ -153,6 +165,4 @@ result.labels.push(...suitesLabels); | ||
| } | ||
| }, this.currentAllureTestUuid); | ||
| this.allureRuntime.stopTest({ | ||
| uuid: this.currentAllureTestUuid | ||
| }); | ||
| this.allureRuntime.stopTest(this.currentAllureTestUuid); | ||
| this.allureRuntime.writeTest(this.currentAllureTestUuid); | ||
@@ -164,4 +174,7 @@ this.currentAllureTestUuid = undefined; | ||
| this.allureRuntime.writeCategoriesDefinitions(); | ||
| // write global container | ||
| this.allureRuntime.writeScope(); | ||
| // write global container (or any remaining scopes) | ||
| this.scopesStack.forEach(scopeUuid => { | ||
| this.allureRuntime.writeScope(scopeUuid); | ||
| }); | ||
| this.scopesStack = []; | ||
| } | ||
@@ -192,18 +205,28 @@ installHooks() { | ||
| done(); | ||
| this.allureRuntime.startFixture(fixtureType, { | ||
| name: fixtureName, | ||
| stage: Stage.FINISHED, | ||
| status: Status.PASSED, | ||
| start | ||
| }); | ||
| this.allureRuntime.stopFixture(); | ||
| var scopeUuid = this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined; | ||
| if (scopeUuid) { | ||
| var fixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, { | ||
| name: fixtureName, | ||
| stage: Stage.FINISHED, | ||
| status: Status.PASSED, | ||
| start | ||
| }); | ||
| if (fixtureUuid) { | ||
| this.allureRuntime.stopFixture(fixtureUuid); | ||
| } | ||
| } | ||
| }).catch(err => { | ||
| done.fail(err); | ||
| this.allureRuntime.startFixture(fixtureType, { | ||
| name: fixtureName, | ||
| stage: Stage.FINISHED, | ||
| status: Status.BROKEN, | ||
| start | ||
| }); | ||
| this.allureRuntime.stopFixture(); | ||
| var scopeUuid = this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined; | ||
| if (scopeUuid) { | ||
| var fixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, { | ||
| name: fixtureName, | ||
| stage: Stage.FINISHED, | ||
| status: Status.BROKEN, | ||
| start | ||
| }); | ||
| if (fixtureUuid) { | ||
| this.allureRuntime.stopFixture(fixtureUuid); | ||
| } | ||
| } | ||
| }); | ||
@@ -213,9 +236,14 @@ } else { | ||
| done(); | ||
| this.allureRuntime.startFixture(fixtureType, { | ||
| name: fixtureName, | ||
| stage: Stage.FINISHED, | ||
| status: Status.PASSED, | ||
| start | ||
| }); | ||
| this.allureRuntime.stopFixture(); | ||
| var scopeUuid = this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined; | ||
| if (scopeUuid) { | ||
| var fixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, { | ||
| name: fixtureName, | ||
| stage: Stage.FINISHED, | ||
| status: Status.PASSED, | ||
| start | ||
| }); | ||
| if (fixtureUuid) { | ||
| this.allureRuntime.stopFixture(fixtureUuid); | ||
| } | ||
| } | ||
| } catch (err) { | ||
@@ -226,13 +254,18 @@ var { | ||
| } = err; | ||
| this.allureRuntime.startFixture(fixtureType, { | ||
| name: fixtureName, | ||
| stage: Stage.FINISHED, | ||
| status: Status.BROKEN, | ||
| statusDetails: { | ||
| message, | ||
| trace: stack | ||
| }, | ||
| start | ||
| }); | ||
| this.allureRuntime.stopFixture(); | ||
| var _scopeUuid = this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined; | ||
| if (_scopeUuid) { | ||
| var _fixtureUuid = this.allureRuntime.startFixture(_scopeUuid, fixtureType, { | ||
| name: fixtureName, | ||
| stage: Stage.FINISHED, | ||
| status: Status.BROKEN, | ||
| statusDetails: { | ||
| message, | ||
| trace: stack | ||
| }, | ||
| start | ||
| }); | ||
| if (_fixtureUuid) { | ||
| this.allureRuntime.stopFixture(_fixtureUuid); | ||
| } | ||
| } | ||
| throw err; | ||
@@ -239,0 +272,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","names":["cwd","allure","Stage","Status","isPromise","FileSystemWriter","MessageWriter","ReporterRuntime","getSuiteLabels","MessageTestRuntime","setGlobalTestRuntime","findAnyError","findMessageAboutThrow","AllureJasmineTestRuntime","constructor","allureJasmineReporter","sendMessage","message","_this","_asyncToGenerator","handleAllureRuntimeMessages","Promise","resolve","AllureJasmineReporter","config","_defineProperty","_ref","testMode","resultsDir","restConfig","_objectWithoutProperties","_excluded","allureRuntime","_objectSpread","writer","testRuntime","installHooks","startScope","getCurrentSpecPath","path","jasmineSuitesStack","map","suite","fullName","filter","Boolean","reduce","_ref2","currentPath","acc","lastPath","newSpecPath","concat","replace","trim","getSpecFullName","spec","specFilename","filename","specPath","description","join","getAllureInterface","applyRuntimeMessages","testUuid","currentAllureTestUuid","jasmineStarted","globalJasmine","globalThis","jasmine","currentAllureResultUuidGetter","currentAllureStepResultGetter","getCurrentStep","originalExpectationHandler","Spec","prototype","addExpectationResult","passed","data","isError","isStepFailed","updateStep","result","status","FAILED","stage","FINISHED","call","suiteStarted","push","suiteDone","pop","writeScope","specStarted","startTest","name","RUNNING","specDone","exceptionInfo","failedExpectations","updateTest","suitesLabels","labels","SKIPPED","PENDING","statusDetails","pendingReason","PASSED","trace","stack","matcherName","BROKEN","stopTest","uuid","writeTest","undefined","jasmineDone","writeEnvironmentInfo","writeCategoriesDefinitions","jasmineBeforeAll","global","beforeAll","jasmineAfterAll","afterAll","jasmineBeforeEach","beforeEach","jasmineAfterEach","afterEach","wrapJasmineHook","original","fixtureType","fixtureName","action","timeout","done","start","Date","now","ret","length","reject","t","fail","then","startFixture","stopFixture","catch","err"],"sources":["../../src/index.ts"],"sourcesContent":["import { cwd } from \"node:process\";\nimport * as allure from \"allure-js-commons\";\nimport { Stage, Status } from \"allure-js-commons\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport { isPromise } from \"allure-js-commons/sdk\";\nimport type { FixtureType } from \"allure-js-commons/sdk/reporter\";\nimport { FileSystemWriter, MessageWriter, ReporterRuntime, getSuiteLabels } from \"allure-js-commons/sdk/reporter\";\nimport { MessageTestRuntime, setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport type { AllureJasmineConfig, JasmineBeforeAfterFn } from \"./model.js\";\nimport { findAnyError, findMessageAboutThrow } from \"./utils.js\";\n\nclass AllureJasmineTestRuntime extends MessageTestRuntime {\n constructor(private readonly allureJasmineReporter: AllureJasmineReporter) {\n super();\n }\n\n async sendMessage(message: RuntimeMessage) {\n this.allureJasmineReporter.handleAllureRuntimeMessages(message);\n await Promise.resolve();\n }\n}\n\nexport default class AllureJasmineReporter implements jasmine.CustomReporter {\n private readonly allureRuntime: ReporterRuntime;\n private currentAllureTestUuid?: string;\n private jasmineSuitesStack: jasmine.SuiteResult[] = [];\n\n constructor(config: AllureJasmineConfig) {\n const { testMode, resultsDir = \"./allure-results\", ...restConfig } = config || {};\n\n this.allureRuntime = new ReporterRuntime({\n ...restConfig,\n writer: testMode\n ? new MessageWriter()\n : new FileSystemWriter({\n resultsDir,\n }),\n });\n\n const testRuntime = new AllureJasmineTestRuntime(this);\n\n setGlobalTestRuntime(testRuntime);\n\n this.installHooks();\n\n // the best place to start global container for hooks and nested suites\n this.allureRuntime.startScope();\n }\n\n private getCurrentSpecPath() {\n const path = this.jasmineSuitesStack.map((suite) => suite?.fullName).filter(Boolean);\n\n return path.filter(Boolean).reduce(\n ([acc, lastPath], currentPath) => {\n const newSpecPath = acc.concat(currentPath.replace(lastPath as string, \"\").trim());\n\n return [newSpecPath, currentPath];\n },\n [[] as string[], \"\"],\n )[0] as string[];\n }\n\n private getSpecFullName(spec: jasmine.SpecResult & { filename?: string }) {\n const specFilename = (spec.filename || \"\").replace(cwd(), \"\").replace(/^[/\\\\]/, \"\");\n const specPath = this.getCurrentSpecPath().concat(spec.description).join(\" > \");\n\n return `${specFilename}#${specPath}`;\n }\n\n getAllureInterface() {\n return allure;\n }\n\n handleAllureRuntimeMessages(message: RuntimeMessage) {\n this.allureRuntime.applyRuntimeMessages([message], { testUuid: this.currentAllureTestUuid! });\n }\n\n jasmineStarted(): void {\n const allureRuntime = this.allureRuntime;\n const globalJasmine = globalThis.jasmine;\n const currentAllureResultUuidGetter = () => this.currentAllureTestUuid;\n const currentAllureStepResultGetter = () => this.allureRuntime.getCurrentStep(currentAllureResultUuidGetter()!);\n // @ts-ignore\n const originalExpectationHandler = globalJasmine.Spec.prototype.addExpectationResult;\n\n // soft-asserts support (when failed assertions don't throw errors)\n // @ts-ignore\n globalJasmine.Spec.prototype.addExpectationResult = function (passed, data, isError) {\n const isStepFailed = !passed && !isError;\n\n if (currentAllureStepResultGetter() && isStepFailed) {\n allureRuntime.updateStep((result) => {\n result.status = Status.FAILED;\n result.stage = Stage.FINISHED;\n }, currentAllureResultUuidGetter()!);\n }\n\n originalExpectationHandler.call(this, passed, data, isError);\n };\n }\n\n suiteStarted(suite: jasmine.SuiteResult): void {\n this.jasmineSuitesStack.push(suite);\n this.allureRuntime.startScope();\n }\n\n suiteDone(): void {\n this.jasmineSuitesStack.pop();\n this.allureRuntime.writeScope();\n }\n\n specStarted(spec: jasmine.SpecResult): void {\n this.currentAllureTestUuid = this.allureRuntime.startTest({\n name: spec.description,\n fullName: this.getSpecFullName(spec),\n stage: Stage.RUNNING,\n });\n }\n\n specDone(spec: jasmine.SpecResult): void {\n const specPath = this.getCurrentSpecPath();\n const exceptionInfo = findMessageAboutThrow(spec.failedExpectations) || findAnyError(spec.failedExpectations);\n\n this.allureRuntime.updateTest((result) => {\n const suitesLabels = getSuiteLabels(specPath);\n\n result.labels.push(...suitesLabels);\n\n if (spec.status === \"pending\" || spec.status === \"disabled\" || spec.status === \"excluded\") {\n result.status = Status.SKIPPED;\n result.stage = Stage.PENDING;\n result.statusDetails = {\n message: spec.pendingReason || \"Suite disabled\",\n };\n return;\n }\n\n result.stage = Stage.FINISHED;\n\n if (spec.status === \"passed\") {\n result.status = Status.PASSED;\n return;\n }\n\n if (exceptionInfo) {\n result.statusDetails = {\n message: exceptionInfo.message,\n trace: exceptionInfo.stack,\n };\n }\n\n if (spec.status === \"failed\" && exceptionInfo?.matcherName) {\n result.status = Status.FAILED;\n return;\n } else {\n result.status = Status.BROKEN;\n return;\n }\n }, this.currentAllureTestUuid!);\n this.allureRuntime.stopTest({ uuid: this.currentAllureTestUuid! });\n this.allureRuntime.writeTest(this.currentAllureTestUuid!);\n this.currentAllureTestUuid = undefined;\n }\n\n jasmineDone(): void {\n this.allureRuntime.writeEnvironmentInfo();\n this.allureRuntime.writeCategoriesDefinitions();\n // write global container\n this.allureRuntime.writeScope();\n }\n\n private installHooks(): void {\n const jasmineBeforeAll: JasmineBeforeAfterFn = global.beforeAll;\n const jasmineAfterAll: JasmineBeforeAfterFn = global.afterAll;\n const jasmineBeforeEach: JasmineBeforeAfterFn = global.beforeEach;\n const jasmineAfterEach: JasmineBeforeAfterFn = global.afterEach;\n const wrapJasmineHook = (original: JasmineBeforeAfterFn, fixtureType: FixtureType, fixtureName: string) => {\n return (action: (done: DoneFn) => void, timeout?: number): void => {\n original((done) => {\n const start = Date.now();\n let ret;\n\n if (action.length > 0) {\n // function takes done callback\n ret = new Promise((resolve, reject) => {\n const t: any = resolve;\n\n t.fail = reject;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n action(t);\n });\n } else {\n ret = action(done);\n }\n\n if (isPromise(ret)) {\n (ret as Promise<any>)\n .then(() => {\n done();\n\n this.allureRuntime.startFixture(fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.PASSED,\n start,\n });\n this.allureRuntime.stopFixture();\n })\n .catch((err) => {\n done.fail(err as Error);\n\n this.allureRuntime.startFixture(fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.BROKEN,\n start,\n });\n this.allureRuntime.stopFixture();\n });\n } else {\n try {\n done();\n\n this.allureRuntime.startFixture(fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.PASSED,\n start,\n });\n this.allureRuntime.stopFixture();\n } catch (err) {\n const { message, stack } = err as Error;\n\n this.allureRuntime.startFixture(fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.BROKEN,\n statusDetails: {\n message,\n trace: stack,\n },\n start,\n });\n this.allureRuntime.stopFixture();\n\n throw err;\n }\n }\n }, timeout);\n };\n };\n\n global.beforeAll = wrapJasmineHook(jasmineBeforeAll, \"before\", \"beforeAll\");\n global.beforeEach = wrapJasmineHook(jasmineBeforeEach, \"before\", \"beforeEach\");\n global.afterAll = wrapJasmineHook(jasmineAfterAll, \"after\", \"afterAll\");\n global.afterEach = wrapJasmineHook(jasmineAfterEach, \"after\", \"afterEach\");\n }\n}\n"],"mappings":";;;;;;;;;;AAAA,SAASA,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,MAAM,MAAM,mBAAmB;AAC3C,SAASC,KAAK,EAAEC,MAAM,QAAQ,mBAAmB;AAEjD,SAASC,SAAS,QAAQ,uBAAuB;AAEjD,SAASC,gBAAgB,EAAEC,aAAa,EAAEC,eAAe,EAAEC,cAAc,QAAQ,gCAAgC;AACjH,SAASC,kBAAkB,EAAEC,oBAAoB,QAAQ,+BAA+B;AAExF,SAASC,YAAY,EAAEC,qBAAqB,QAAQ,YAAY;AAEhE,MAAMC,wBAAwB,SAASJ,kBAAkB,CAAC;EACxDK,WAAWA,CAAkBC,qBAA4C,EAAE;IACzE,KAAK,CAAC,CAAC;IAAC,KADmBA,qBAA4C,GAA5CA,qBAA4C;EAEzE;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oF,QAAQ;gBACrBH,MAAM,EAAEhF,MAAM,CAAC4G,MAAM;gBACrBN,aAAa,EAAE;kBACbxF,OAAO;kBACP2F,KAAK,EAAEC;gBACT,CAAC;gBACD0B;cACF,CAAC,CAAC;cACF,IAAI,CAACvG,aAAa,CAACiH,WAAW,CAAC,CAAC;cAEhC,MAAME,GAAG;YACX;UACF;QACF,CAAC,EAAEd,OAAO,CAAC;MACb,CAAC;IACH,CAAC;IAEDb,MAAM,CAACC,SAAS,GAAGO,eAAe,CAACT,gBAAgB,EAAE,QAAQ,EAAE,WAAW,CAAC;IAC3EC,MAAM,CAACK,UAAU,GAAGG,eAAe,CAACJ,iBAAiB,EAAE,QAAQ,EAAE,YAAY,CAAC;IAC9EJ,MAAM,CAACG,QAAQ,GAAGK,eAAe,CAACN,eAAe,EAAE,OAAO,EAAE,UAAU,CAAC;IACvEF,MAAM,CAACO,SAAS,GAAGC,eAAe,CAACF,gBAAgB,EAAE,OAAO,EAAE,WAAW,CAAC;EAC5E;AACF","ignoreList":[]} | ||
| {"version":3,"file":"index.js","names":["cwd","env","allure","Stage","Status","isPromise","FileSystemWriter","MessageWriter","ReporterRuntime","getSuiteLabels","MessageTestRuntime","setGlobalTestRuntime","findAnyError","findMessageAboutThrow","AllureJasmineTestRuntime","constructor","allureJasmineReporter","sendMessage","message","_this","_asyncToGenerator","handleAllureRuntimeMessages","Promise","resolve","ALLURE_TEST_MODE","AllureJasmineReporter","config","_defineProperty","_ref","resultsDir","restConfig","_objectWithoutProperties","_excluded","allureRuntime","_objectSpread","writer","testRuntime","installHooks","scopeUuid","startScope","scopesStack","push","getCurrentSpecPath","path","jasmineSuitesStack","map","suite","fullName","filter","Boolean","reduce","_ref2","currentPath","acc","lastPath","newSpecPath","concat","replace","trim","getSpecFullName","spec","specFilename","filename","specPath","description","join","getAllureInterface","currentAllureTestUuid","applyRuntimeMessages","jasmineStarted","globalJasmine","globalThis","jasmine","currentAllureStepResultGetter","currentStep","undefined","originalExpectationHandler","Spec","prototype","addExpectationResult","passed","data","isError","isStepFailed","stepUuid","updateStep","result","status","FAILED","stage","FINISHED","call","suiteStarted","suiteDone","pop","writeScope","specStarted","startTest","name","RUNNING","specDone","exceptionInfo","failedExpectations","updateTest","suitesLabels","labels","SKIPPED","PENDING","statusDetails","pendingReason","PASSED","trace","stack","matcherName","BROKEN","stopTest","writeTest","jasmineDone","writeEnvironmentInfo","writeCategoriesDefinitions","forEach","jasmineBeforeAll","global","beforeAll","jasmineAfterAll","afterAll","jasmineBeforeEach","beforeEach","jasmineAfterEach","afterEach","wrapJasmineHook","original","fixtureType","fixtureName","action","timeout","done","start","Date","now","ret","length","reject","t","fail","then","fixtureUuid","startFixture","stopFixture","catch","err"],"sources":["../../src/index.ts"],"sourcesContent":["import { cwd, env } from \"node:process\";\nimport * as allure from \"allure-js-commons\";\nimport { Stage, Status } from \"allure-js-commons\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport { isPromise } from \"allure-js-commons/sdk\";\nimport type { Config, FixtureType } from \"allure-js-commons/sdk/reporter\";\nimport { FileSystemWriter, MessageWriter, ReporterRuntime, getSuiteLabels } from \"allure-js-commons/sdk/reporter\";\nimport { MessageTestRuntime, setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport type { JasmineBeforeAfterFn } from \"./model.js\";\nimport { findAnyError, findMessageAboutThrow } from \"./utils.js\";\n\nclass AllureJasmineTestRuntime extends MessageTestRuntime {\n constructor(private readonly allureJasmineReporter: AllureJasmineReporter) {\n super();\n }\n\n async sendMessage(message: RuntimeMessage) {\n this.allureJasmineReporter.handleAllureRuntimeMessages(message);\n await Promise.resolve();\n }\n}\n\nconst { ALLURE_TEST_MODE } = env;\n\nexport default class AllureJasmineReporter implements jasmine.CustomReporter {\n private readonly allureRuntime: ReporterRuntime;\n private currentAllureTestUuid?: string;\n private jasmineSuitesStack: jasmine.SuiteResult[] = [];\n private scopesStack: string[] = [];\n\n constructor(config: Config) {\n const { resultsDir = \"./allure-results\", ...restConfig } = config || {};\n\n this.allureRuntime = new ReporterRuntime({\n ...restConfig,\n writer: ALLURE_TEST_MODE\n ? new MessageWriter()\n : new FileSystemWriter({\n resultsDir,\n }),\n });\n\n const testRuntime = new AllureJasmineTestRuntime(this);\n\n setGlobalTestRuntime(testRuntime);\n\n this.installHooks();\n\n // the best place to start global container for hooks and nested suites\n const scopeUuid = this.allureRuntime.startScope();\n this.scopesStack.push(scopeUuid);\n }\n\n private getCurrentSpecPath() {\n const path = this.jasmineSuitesStack.map((suite) => suite?.fullName).filter(Boolean);\n\n return path.filter(Boolean).reduce(\n ([acc, lastPath], currentPath) => {\n const newSpecPath = acc.concat(currentPath.replace(lastPath as string, \"\").trim());\n\n return [newSpecPath, currentPath];\n },\n [[] as string[], \"\"],\n )[0] as string[];\n }\n\n private getSpecFullName(spec: jasmine.SpecResult & { filename?: string }) {\n const specFilename = (spec.filename || \"\").replace(cwd(), \"\").replace(/^[/\\\\]/, \"\");\n const specPath = this.getCurrentSpecPath().concat(spec.description).join(\" > \");\n\n return `${specFilename}#${specPath}`;\n }\n\n getAllureInterface() {\n return allure;\n }\n\n handleAllureRuntimeMessages(message: RuntimeMessage) {\n if (!this.currentAllureTestUuid) {\n return;\n }\n this.allureRuntime.applyRuntimeMessages(this.currentAllureTestUuid, [message]);\n }\n\n jasmineStarted(): void {\n const allureRuntime = this.allureRuntime;\n const globalJasmine = globalThis.jasmine;\n const currentAllureStepResultGetter = () =>\n this.currentAllureTestUuid ? this.allureRuntime.currentStep(this.currentAllureTestUuid) : undefined;\n // @ts-ignore\n const originalExpectationHandler = globalJasmine.Spec.prototype.addExpectationResult;\n\n // soft-asserts support (when failed assertions don't throw errors)\n // @ts-ignore\n globalJasmine.Spec.prototype.addExpectationResult = function (passed, data, isError) {\n const isStepFailed = !passed && !isError;\n\n const stepUuid = currentAllureStepResultGetter();\n if (stepUuid && isStepFailed) {\n allureRuntime.updateStep(stepUuid, (result) => {\n result.status = Status.FAILED;\n result.stage = Stage.FINISHED;\n });\n }\n\n originalExpectationHandler.call(this, passed, data, isError);\n };\n }\n\n suiteStarted(suite: jasmine.SuiteResult): void {\n this.jasmineSuitesStack.push(suite);\n const scopeUuid = this.allureRuntime.startScope();\n this.scopesStack.push(scopeUuid);\n }\n\n suiteDone(): void {\n this.jasmineSuitesStack.pop();\n const scopeUuid = this.scopesStack.pop();\n if (scopeUuid) {\n this.allureRuntime.writeScope(scopeUuid);\n }\n }\n\n specStarted(spec: jasmine.SpecResult): void {\n this.currentAllureTestUuid = this.allureRuntime.startTest(\n {\n name: spec.description,\n fullName: this.getSpecFullName(spec),\n stage: Stage.RUNNING,\n },\n this.scopesStack,\n );\n }\n\n specDone(spec: jasmine.SpecResult): void {\n if (!this.currentAllureTestUuid) {\n return;\n }\n const specPath = this.getCurrentSpecPath();\n const exceptionInfo = findMessageAboutThrow(spec.failedExpectations) || findAnyError(spec.failedExpectations);\n\n this.allureRuntime.updateTest(this.currentAllureTestUuid, (result) => {\n const suitesLabels = getSuiteLabels(specPath);\n\n result.labels.push(...suitesLabels);\n\n if (spec.status === \"pending\" || spec.status === \"disabled\" || spec.status === \"excluded\") {\n result.status = Status.SKIPPED;\n result.stage = Stage.PENDING;\n result.statusDetails = {\n message: spec.pendingReason || \"Suite disabled\",\n };\n return;\n }\n\n result.stage = Stage.FINISHED;\n\n if (spec.status === \"passed\") {\n result.status = Status.PASSED;\n return;\n }\n\n if (exceptionInfo) {\n result.statusDetails = {\n message: exceptionInfo.message,\n trace: exceptionInfo.stack,\n };\n }\n\n if (spec.status === \"failed\" && exceptionInfo?.matcherName) {\n result.status = Status.FAILED;\n return;\n } else {\n result.status = Status.BROKEN;\n return;\n }\n });\n this.allureRuntime.stopTest(this.currentAllureTestUuid);\n this.allureRuntime.writeTest(this.currentAllureTestUuid);\n this.currentAllureTestUuid = undefined;\n }\n\n jasmineDone(): void {\n this.allureRuntime.writeEnvironmentInfo();\n this.allureRuntime.writeCategoriesDefinitions();\n // write global container (or any remaining scopes)\n this.scopesStack.forEach((scopeUuid) => {\n this.allureRuntime.writeScope(scopeUuid);\n });\n this.scopesStack = [];\n }\n\n private installHooks(): void {\n const jasmineBeforeAll: JasmineBeforeAfterFn = global.beforeAll;\n const jasmineAfterAll: JasmineBeforeAfterFn = global.afterAll;\n const jasmineBeforeEach: JasmineBeforeAfterFn = global.beforeEach;\n const jasmineAfterEach: JasmineBeforeAfterFn = global.afterEach;\n const wrapJasmineHook = (original: JasmineBeforeAfterFn, fixtureType: FixtureType, fixtureName: string) => {\n return (action: (done: DoneFn) => void, timeout?: number): void => {\n original((done) => {\n const start = Date.now();\n let ret;\n\n if (action.length > 0) {\n // function takes done callback\n ret = new Promise((resolve, reject) => {\n const t: any = resolve;\n\n t.fail = reject;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n action(t);\n });\n } else {\n ret = action(done);\n }\n\n if (isPromise(ret)) {\n (ret as Promise<any>)\n .then(() => {\n done();\n\n const scopeUuid =\n this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined;\n if (scopeUuid) {\n const fixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.PASSED,\n start,\n });\n if (fixtureUuid) {\n this.allureRuntime.stopFixture(fixtureUuid);\n }\n }\n })\n .catch((err) => {\n done.fail(err as Error);\n const scopeUuid =\n this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined;\n if (scopeUuid) {\n const fixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.BROKEN,\n start,\n });\n if (fixtureUuid) {\n this.allureRuntime.stopFixture(fixtureUuid);\n }\n }\n });\n } else {\n try {\n done();\n const scopeUuid = this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined;\n if (scopeUuid) {\n const fixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.PASSED,\n start,\n });\n if (fixtureUuid) {\n this.allureRuntime.stopFixture(fixtureUuid);\n }\n }\n } catch (err) {\n const { message, stack } = err as Error;\n const scopeUuid = this.scopesStack.length > 0 ? this.scopesStack[this.scopesStack.length - 1] : undefined;\n if (scopeUuid) {\n const fixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, {\n name: fixtureName,\n stage: Stage.FINISHED,\n status: Status.BROKEN,\n statusDetails: {\n message,\n trace: stack,\n },\n start,\n });\n if (fixtureUuid) {\n this.allureRuntime.stopFixture(fixtureUuid);\n }\n }\n\n throw err;\n }\n }\n }, timeout);\n };\n };\n\n global.beforeAll = wrapJasmineHook(jasmineBeforeAll, \"before\", \"beforeAll\");\n global.beforeEach = wrapJasmineHook(jasmineBeforeEach, \"before\", \"beforeEach\");\n global.afterAll = wrapJasmineHook(jasmineAfterAll, \"after\", \"afterAll\");\n global.afterEach = wrapJasmineHook(jasmineAfterEach, \"after\", \"afterEach\");\n }\n}\n"],"mappings":";;;;;;;;;;AAAA,SAASA,GAAG,EAAEC,GAAG,QAAQ,cAAc;AACvC,OAAO,KAAKC,MAAM,MAAM,mBAAmB;AAC3C,SAASC,KAAK,EAAEC,MAAM,QAAQ,mBAAmB;AAEjD,SAASC,SAAS,QAAQ,uBAAuB;AAEjD,SAASC,gBAAgB,EAAEC,aAAa,EAAEC,eAAe,EAAEC,cAAc,QAAQ,gCAAgC;AACjH,SAASC,kBAAkB,EAAEC,oBAAoB,QAAQ,+BAA+B;AAExF,SAASC,YAAY,EAAEC,qBAAqB,QAAQ,YAAY;AAEhE,MAAMC,wBAAwB,SAASJ,kBAAkB,CAAC;EACxDK,WAAWA,CAAkBC,qBAA4C,EAAE;IACzE,KAAK,CAAC,CAAC;IAAC,KADmBA,qBAA4C,GAA5CA,qBAA4C;EAEzE;EAEMC,WAAWA,CAACC,OAAuB,EAAE;IAAA,IAAAC,KAAA;IAAA,OAAAC,iBAAA;MACzCD,K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ACA,WAAW,CAACqG,MAAM,GAAG,CAAC,CAAC,GAAGlE,SAAS;cACzG,IAAIrC,UAAS,EAAE;gBACb,IAAM4G,YAAW,GAAG,IAAI,CAACjH,aAAa,CAACkH,YAAY,CAAC7G,UAAS,EAAE8F,WAAW,EAAE;kBAC1ElC,IAAI,EAAEmC,WAAW;kBACjB5C,KAAK,EAAEtF,KAAK,CAACuF,QAAQ;kBACrBH,MAAM,EAAEnF,MAAM,CAAC8G,MAAM;kBACrBN,aAAa,EAAE;oBACb1F,OAAO;oBACP6F,KAAK,EAAEC;kBACT,CAAC;kBACDyB;gBACF,CAAC,CAAC;gBACF,IAAIS,YAAW,EAAE;kBACf,IAAI,CAACjH,aAAa,CAACmH,WAAW,CAACF,YAAW,CAAC;gBAC7C;cACF;cAEA,MAAMI,GAAG;YACX;UACF;QACF,CAAC,EAAEf,OAAO,CAAC;MACb,CAAC;IACH,CAAC;IAEDb,MAAM,CAACC,SAAS,GAAGO,eAAe,CAACT,gBAAgB,EAAE,QAAQ,EAAE,WAAW,CAAC;IAC3EC,MAAM,CAACK,UAAU,GAAGG,eAAe,CAACJ,iBAAiB,EAAE,QAAQ,EAAE,YAAY,CAAC;IAC9EJ,MAAM,CAACG,QAAQ,GAAGK,eAAe,CAACN,eAAe,EAAE,OAAO,EAAE,UAAU,CAAC;IACvEF,MAAM,CAACO,SAAS,GAAGC,eAAe,CAACF,gBAAgB,EAAE,OAAO,EAAE,WAAW,CAAC;EAC5E;AACF","ignoreList":[]} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"model.js","names":[],"sources":["../../src/model.ts"],"sourcesContent":["import type { Config } from \"allure-js-commons/sdk/reporter\";\n\nexport interface AllureJasmineConfig extends Config {\n testMode?: boolean;\n}\n\nexport type JasmineBeforeAfterFn = (action: (done: DoneFn) => void, timeout?: number) => void;\n"],"mappings":"","ignoreList":[]} | ||
| {"version":3,"file":"model.js","names":[],"sources":["../../src/model.ts"],"sourcesContent":["export type JasmineBeforeAfterFn = (action: (done: DoneFn) => void, timeout?: number) => void;\n"],"mappings":"","ignoreList":[]} |
| /// <reference types="jasmine" /> | ||
| import * as allure from "allure-js-commons"; | ||
| import type { RuntimeMessage } from "allure-js-commons/sdk"; | ||
| import type { AllureJasmineConfig } from "./model.js"; | ||
| import type { Config } from "allure-js-commons/sdk/reporter"; | ||
| export default class AllureJasmineReporter implements jasmine.CustomReporter { | ||
@@ -9,3 +9,4 @@ private readonly allureRuntime; | ||
| private jasmineSuitesStack; | ||
| constructor(config: AllureJasmineConfig); | ||
| private scopesStack; | ||
| constructor(config: Config); | ||
| private getCurrentSpecPath; | ||
@@ -12,0 +13,0 @@ private getSpecFullName; |
| /// <reference types="jasmine" /> | ||
| import type { Config } from "allure-js-commons/sdk/reporter"; | ||
| export interface AllureJasmineConfig extends Config { | ||
| testMode?: boolean; | ||
| } | ||
| export type JasmineBeforeAfterFn = (action: (done: DoneFn) => void, timeout?: number) => void; |
+8
-4
| { | ||
| "name": "allure-jasmine", | ||
| "version": "3.0.0-beta.3", | ||
| "version": "3.0.0-beta.4", | ||
| "description": "Allure Jasmine integration", | ||
@@ -30,3 +30,4 @@ "homepage": "https://allurereport.org/", | ||
| "scripts": { | ||
| "clean": "rimraf ./dist", | ||
| "allure-report": "allure serve ./out/allure-results", | ||
| "clean": "rimraf ./dist ./out", | ||
| "compile": "run-s 'compile:*'", | ||
@@ -37,2 +38,3 @@ "compile:esm-babel": "babel --config-file ./babel.esm.json ./src --out-dir ./dist/esm --extensions '.ts' --source-maps", | ||
| "compile:fixup": "node ./scripts/fixup.mjs", | ||
| "generate-report": "allure generate ./out/allure-results -o ./out/allure-report --clean", | ||
| "lint": "eslint ./src ./test --ext .ts", | ||
@@ -43,3 +45,3 @@ "lint:fix": "eslint ./src ./test --ext .ts --fix", | ||
| "dependencies": { | ||
| "allure-js-commons": "3.0.0-beta.3" | ||
| "allure-js-commons": "3.0.0-beta.4" | ||
| }, | ||
@@ -58,2 +60,4 @@ "devDependencies": { | ||
| "@typescript-eslint/parser": "^7.0.0", | ||
| "allure-commandline": "^2.29.0", | ||
| "allure-vitest": "3.0.0-beta.4", | ||
| "babel-plugin-add-module-exports": "^1.0.4", | ||
@@ -72,4 +76,4 @@ "eslint": "^8.57.0", | ||
| "typescript": "^5.2.2", | ||
| "vitest": "^1.5.3" | ||
| "vitest": "^1.6.0" | ||
| } | ||
| } |
83925
12.23%609
11.54%27
8%+ Added
- Removed