allure-jest 3.0.0-beta.1 → 3.0.0-beta.10

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.
@@ -17,15 +17,7 @@ class AllureJestTestRuntime extends _runtime.MessageTestRuntime {
17
17
  sendMessage(message) {
18
18
  var _this = this;
19
19
  return _asyncToGenerator(function* () {
20
- var {
21
- currentTestName,
22
- currentConcurrentTestName
23
- } = _this.context.expect.getState();
24
- var testName = currentTestName || (currentConcurrentTestName === null || currentConcurrentTestName === void 0 ? void 0 : currentConcurrentTestName());
25
- _this.jestEnvironment.handleAllureRuntimeMessage({
26
- currentTestName: testName,
27
- message
28
- });
20
+ _this.jestEnvironment.handleAllureRuntimeMessage(message);
29
21
  yield Promise.resolve();
30
22
  })();
31
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AllureJestTestRuntime.js","names":["_runtime","require","asyncGeneratorStep","n","t","e","r","o","a","c","i","u","value","done","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","AllureJestTestRuntime","MessageTestRuntime","constructor","jestEnvironment","context","allureTestRuntime","sendMessage","message","_this","currentTestName","currentConcurrentTestName","expect","getState","testName","handleAllureRuntimeMessage","exports"],"sources":["../../src/AllureJestTestRuntime.ts"],"sourcesContent":["import type { JestExpect } from \"@jest/expect\";\nimport type { Global } from \"@jest/types\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport { MessageTestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport type { AllureJestEnvironment } from \"./model.js\";\n\nexport class AllureJestTestRuntime extends MessageTestRuntime {\n constructor(\n private readonly jestEnvironment: AllureJestEnvironment,\n private readonly context: Global.Global,\n ) {\n super();\n context.allureTestRuntime = () => this;\n }\n\n async sendMessage(message: RuntimeMessage) {\n const { currentTestName, currentConcurrentTestName } = (this.context.expect as JestExpect).getState();\n const testName = currentTestName || currentConcurrentTestName?.();\n\n this.jestEnvironment.handleAllureRuntimeMessage({\n currentTestName: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C;MAA0B,CAAC,GAAIF,KAAI,CAACJ,OAAO,CAACO,MAAM,CAAgBC,QAAQ,CAAC,CAAC;MACrG,IAAMC,QAAQ,GAAGJ,eAAe,KAAIC,yBAAyB,aAAzBA,yBAAyB,uBAAzBA,yBAAyB,CAAG,CAAC;MAEjEF,KAAI,CAACL,eAAe,CAACW,0BAA0B,CAAC;QAC9CL,eAAe,EAAEI,QAAkB;QACnCN;MACF,CAAC,CAAC;MAEF,MAAMf,OAAO,CAACC,OAAO,CAAC,CAAC;IAAC;EAC1B;AACF;AAACsB,OAAA,CAAAf,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"file":"AllureJestTestRuntime.js","names":["_runtime","require","asyncGeneratorStep","n","t","e","r","o","a","c","i","u","value","done","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","AllureJestTestRuntime","MessageTestRuntime","constructor","jestEnvironment","context","allureTestRuntime","sendMessage","message","_this","handleAllureRuntimeMessage","exports"],"sources":["../../src/AllureJestTestRuntime.ts"],"sourcesContent":["import type { Global } from \"@jest/types\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport { MessageTestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport type { AllureJestEnvironment } from \"./model.js\";\n\nexport class AllureJestTestRuntime extends MessageTestRuntime {\n constructor(\n private readonly jestEnvironment: AllureJestEnvironment,\n private readonly context: Global.Global,\n ) {\n super();\n context.allureTestRuntime = () => this;\n }\n\n async sendMessage(message: RuntimeMessage) {\n this.jestEnvironment.handleAllureRuntimeMessage(message);\n\n await Promise.resolve();\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAAmE,SAAAC,mBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,cAAAC,CAAA,GAAAP,CAAA,CAAAK,CAAA,EAAAC,CAAA,GAAAE,CAAA,GAAAD,CAAA,CAAAE,KAAA,WAAAT,CAAA,gBAAAE,CAAA,CAAAF,CAAA,KAAAO,CAAA,CAAAG,IAAA,GAAAT,CAAA,CAAAO,CAAA,IAAAG,OAAA,CAAAC,OAAA,CAAAJ,CAAA,EAAAK,IAAA,CAAAV,CAAA,EAAAC,CAAA;AAAA,SAAAU,kBAAAd,CAAA,6BAAAC,CAAA,SAAAC,CAAA,GAAAa,SAAA,aAAAJ,OAAA,WAAAR,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAL,CAAA,CAAAgB,KAAA,CAAAf,CAAA,EAAAC,CAAA,YAAAe,MAAAjB,CAAA,IAAAD,kBAAA,CAAAM,CAAA,EAAAF,CAAA,EAAAC,CAAA,EAAAa,KAAA,EAAAC,MAAA,UAAAlB,CAAA,cAAAkB,OAAAlB,CAAA,IAAAD,kBAAA,CAAAM,CAAA,EAAAF,CAAA,EAAAC,CAAA,EAAAa,KAAA,EAAAC,MAAA,WAAAlB,CAAA,KAAAiB,KAAA;AAG5D,MAAME,qBAAqB,SAASC,2BAAkB,CAAC;EAC5DC,WAAWA,CACQC,eAAsC,EACtCC,OAAsB,EACvC;IACA,KAAK,CAAC,CAAC;IAAC,KAHSD,eAAsC,GAAtCA,eAAsC;IAAA,KACtCC,OAAsB,GAAtBA,OAAsB;IAGvCA,OAAO,CAACC,iBAAiB,GAAG,MAAM,IAAI;EACxC;EAEMC,WAAWA,CAACC,OAAuB,EAAE;IAAA,IAAAC,KAAA;IAAA,OAAAb,iBAAA;MACzCa,KAAI,CAACL,eAAe,CAACM,0BAA0B,CAACF,OAAO,CAAC;MAExD,MAAMf,OAAO,CAACC,OAAO,CAAC,CAAC;IAAC;EAC1B;AACF;AAACiB,OAAA,CAAAV,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -14,7 +14,7 @@ var _reporter = require("allure-js-commons/sdk/reporter");
14
14
  var _runtime = require("allure-js-commons/sdk/runtime");
15
15
  var _AllureJestTestRuntime = require("./AllureJestTestRuntime.js");
16
16
  var _utils = require("./utils.js");
17
- var _excluded = ["resultsDir", "testMode"];
17
+ var _excluded = ["resultsDir"];
18
18
  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); }
19
19
  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; }
20
20
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -22,9 +22,12 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
22
22
  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; }
23
23
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
24
24
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
25
+ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
26
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
25
27
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
26
28
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
27
29
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
30
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
28
31
  var {
29
32
  ALLURE_HOST_NAME,
30
33
  ALLURE_THREAD_NAME,
@@ -32,64 +35,78 @@ var {
32
35
  } = _nodeProcess.default.env;
33
36
  var hostname = _nodeOs.default.hostname();
34
37
  var createJestEnvironment = Base => {
38
+ var _Class_brand;
35
39
  // @ts-expect-error (ts(2545)) Incorrect assumption about a mixin class: https://github.com/microsoft/TypeScript/issues/37142
36
- return class extends Base {
40
+ return _Class_brand = /*#__PURE__*/new WeakSet(), class extends Base {
41
+ // config is AllureJestConfig in Jest v28 or greater. In older versions
42
+ // it's AllureJestProjectConfig. See https://github.com/jestjs/jest/pull/12461
37
43
  constructor(config, context) {
38
- var _config$projectConfig;
39
44
  super(config, context);
45
+ _classPrivateMethodInitSpec(this, _Class_brand);
40
46
  _defineProperty(this, "testPath", void 0);
47
+ _defineProperty(this, "testPlan", void 0);
41
48
  _defineProperty(this, "runtime", void 0);
42
- _defineProperty(this, "allureUuidsByTestIds", new Map());
43
- _defineProperty(this, "handleTestEvent", (event, state) => {
49
+ _defineProperty(this, "runContext", {
50
+ executables: [],
51
+ steps: [],
52
+ scopes: [],
53
+ skippedTestsFullNamesByTestPlan: []
54
+ });
55
+ _defineProperty(this, "handleTestEvent", event => {
44
56
  switch (event.name) {
45
- case "test_retry":
46
- this.handleTestAdd({
47
- testName: event.test.name,
48
- concurrent: event.test.concurrent,
49
- state
50
- });
57
+ case "hook_start":
58
+ _assertClassBrand(_Class_brand, this, _handleHookStart).call(this, event.hook);
59
+ break;
60
+ case "hook_success":
61
+ _assertClassBrand(_Class_brand, this, _handleHookPass).call(this, event.hook);
62
+ break;
63
+ case "hook_failure":
64
+ _assertClassBrand(_Class_brand, this, _handleHookFail).call(this, event.hook, event.error);
51
65
  break;
52
- case "add_test":
53
- this.handleTestAdd({
54
- testName: event.testName,
55
- concurrent: event.concurrent,
56
- state
57
- });
66
+ case "run_describe_start":
67
+ _assertClassBrand(_Class_brand, this, _handleSuiteStart).call(this);
68
+ break;
69
+ case "run_describe_finish":
70
+ _assertClassBrand(_Class_brand, this, _handleSuiteEnd).call(this);
58
71
  break;
59
72
  case "test_start":
60
- this.handleTestStart(event.test);
73
+ _assertClassBrand(_Class_brand, this, _handleTestStart).call(this, event.test);
74
+ break;
75
+ case "test_done":
76
+ _assertClassBrand(_Class_brand, this, _handleTestDone).call(this);
61
77
  break;
62
78
  case "test_todo":
63
- this.handleTestTodo(event.test);
79
+ _assertClassBrand(_Class_brand, this, _handleTestTodo).call(this, event.test);
64
80
  break;
65
81
  case "test_fn_success":
66
- this.handleTestPass(event.test);
82
+ _assertClassBrand(_Class_brand, this, _handleTestPass).call(this, event.test);
67
83
  break;
68
84
  case "test_fn_failure":
69
- this.handleTestFail(event.test);
85
+ _assertClassBrand(_Class_brand, this, _handleTestFail).call(this, event.test);
70
86
  break;
71
87
  case "test_skip":
72
- this.handleTestSkip(event.test);
88
+ _assertClassBrand(_Class_brand, this, _handleTestSkip).call(this, event.test);
73
89
  break;
74
- case "test_done":
75
- this.handleTestDone(event.test);
90
+ case "run_finish":
91
+ _assertClassBrand(_Class_brand, this, _handleRunFinish).call(this);
76
92
  break;
77
93
  default:
78
94
  break;
79
95
  }
80
96
  });
81
- var _ref = (config === null || config === void 0 || (_config$projectConfig = config.projectConfig) === null || _config$projectConfig === void 0 ? void 0 : _config$projectConfig.testEnvironmentOptions) || {},
97
+ var projectConfig = "projectConfig" in config ? config.projectConfig : config;
98
+ var _ref = (projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.testEnvironmentOptions) || {},
82
99
  {
83
- resultsDir = "allure-results",
84
- testMode = false
100
+ resultsDir
85
101
  } = _ref,
86
102
  restConfig = _objectWithoutProperties(_ref, _excluded);
87
103
  this.runtime = new _reporter.ReporterRuntime(_objectSpread(_objectSpread({}, restConfig), {}, {
88
- writer: testMode ? new _reporter.MessageWriter() : new _reporter.FileSystemWriter({
104
+ writer: (0, _reporter.createDefaultWriter)({
89
105
  resultsDir
90
106
  })
91
107
  }));
92
- this.testPath = context.testPath.replace(config.globalConfig.rootDir, "").replace(_nodePath.sep, "");
108
+ this.testPath = context.testPath.replace(projectConfig.rootDir, "").replace(_nodePath.sep, "");
109
+ this.testPlan = (0, _reporter.parseTestPlan)();
93
110
 
94
111
  // @ts-ignore
95
112
  var testRuntime = new _AllureJestTestRuntime.AllureJestTestRuntime(this, this.global);
@@ -104,166 +121,199 @@ var createJestEnvironment = Base => {
104
121
  teardown() {
105
122
  return super.teardown();
106
123
  }
107
- handleAllureRuntimeMessage(payload) {
108
- var testUuid = this.getTestUuid({
109
- name: payload.currentTestName,
110
- // little hack because first element in the path will be always ommited
111
- parent: {
112
- name: "ROOT_DESCRIBE_BLOCK"
113
- }
114
- });
115
- this.runtime.applyRuntimeMessages([payload.message], {
116
- testUuid
117
- });
124
+ handleAllureRuntimeMessage(message) {
125
+ var executableUuid = (0, _utils.last)(this.runContext.executables);
126
+ this.runtime.applyRuntimeMessages(executableUuid, [message]);
118
127
  }
119
- getTestUuid(test) {
120
- var testPath = (0, _utils.getTestPath)(test);
121
- var currentTestId = (0, _utils.getTestId)(testPath);
122
- var testUuid = this.allureUuidsByTestIds.get(currentTestId);
123
- if (!testUuid) {
124
- // eslint-disable-next-line no-console
125
- console.error("Can't find \"".concat(currentTestId, "\" test while tried to start it!"));
126
- return undefined;
127
- }
128
- return testUuid;
128
+ };
129
+ function _getTestFullName(test) {
130
+ var newTestSuitePath = (0, _utils.getTestPath)(test.parent);
131
+ var newTestPath = newTestSuitePath.concat(test.name);
132
+ var newTestId = (0, _utils.getTestId)(newTestPath);
133
+ return "".concat(this.testPath, "#").concat(newTestId);
134
+ }
135
+ function _handleSuiteStart() {
136
+ _assertClassBrand(_Class_brand, this, _startScope).call(this);
137
+ }
138
+ function _handleSuiteEnd() {
139
+ _assertClassBrand(_Class_brand, this, _stopScope).call(this);
140
+ }
141
+ function _handleHookStart(hook) {
142
+ if ((0, _utils.shouldHookBeSkipped)(hook)) {
143
+ return;
129
144
  }
130
- handleTestAdd(payload) {
131
- var {
132
- testName,
133
- state
134
- } = payload;
135
- var {
136
- currentDescribeBlock
137
- } = state;
138
- var newTestSuitesPath = (0, _utils.getTestPath)(currentDescribeBlock);
139
- var newTestPath = newTestSuitesPath.concat(testName);
140
- var newTestId = (0, _utils.getTestId)(newTestPath);
141
- var threadLabel = ALLURE_THREAD_NAME || JEST_WORKER_ID || _nodeProcess.default.pid.toString();
142
- var hostLabel = ALLURE_HOST_NAME || hostname;
143
- var packageLabel = (0, _nodePath.dirname)(this.testPath).split(_nodePath.sep).join(".");
144
- var testUuid = this.runtime.startTest({
145
- name: testName,
146
- fullName: newTestId,
147
- labels: [{
148
- name: _allureJsCommons.LabelName.LANGUAGE,
149
- value: "javascript"
150
- }, {
151
- name: _allureJsCommons.LabelName.FRAMEWORK,
152
- value: "jest"
153
- }, {
154
- name: _allureJsCommons.LabelName.PACKAGE,
155
- value: packageLabel
156
- }]
157
- });
158
- this.runtime.updateTest(result => {
159
- if (threadLabel) {
160
- result.labels.push({
161
- name: _allureJsCommons.LabelName.THREAD,
162
- value: threadLabel
163
- });
164
- }
165
- if (hostLabel) {
166
- result.labels.push({
167
- name: _allureJsCommons.LabelName.HOST,
168
- value: hostLabel
169
- });
170
- }
171
- result.labels.push(...(0, _reporter.getSuitesLabels)(newTestSuitesPath));
172
- }, testUuid);
173
-
174
- /**
175
- * If user have some tests with the same name, reporter will throw an error due the test with
176
- * the same name could be removed from the running tests, so better to throw an explicit error
177
- */
178
- if (this.allureUuidsByTestIds.has(newTestId)) {
179
- // eslint-disable-next-line no-console
180
- console.error("Test \"".concat(newTestId, "\" has been already initialized! To continue with reporting, please rename the test."));
181
- return;
182
- }
183
- this.allureUuidsByTestIds.set(newTestId, testUuid);
145
+ var scopeUuid = (0, _utils.last)(this.runContext.scopes);
146
+ var fixtureUuid = this.runtime.startFixture(scopeUuid, /after/i.test(hook.type) ? "after" : "before", {
147
+ name: hook.type
148
+ });
149
+ this.runContext.executables.push(fixtureUuid);
150
+ }
151
+ function _handleHookPass(hook) {
152
+ if ((0, _utils.shouldHookBeSkipped)(hook)) {
153
+ return;
184
154
  }
185
- handleTestStart(test) {
186
- var testUuid = this.getTestUuid(test);
187
- if (!testUuid) {
188
- return;
189
- }
190
- this.runtime.updateTest(result => {
191
- result.stage = _allureJsCommons.Stage.RUNNING;
192
- }, testUuid);
155
+ var fixtureUuid = this.runContext.executables.pop();
156
+ this.runtime.updateFixture(fixtureUuid, r => {
157
+ r.status = _allureJsCommons.Status.PASSED;
158
+ r.stage = _allureJsCommons.Stage.FINISHED;
159
+ });
160
+ this.runtime.stopFixture(fixtureUuid);
161
+ }
162
+ function _handleHookFail(hook, error) {
163
+ if ((0, _utils.shouldHookBeSkipped)(hook)) {
164
+ return;
193
165
  }
194
- handleTestPass(test) {
195
- var testUuid = this.getTestUuid(test);
196
- if (!testUuid) {
197
- return;
198
- }
199
- this.runtime.updateTest(result => {
200
- result.stage = _allureJsCommons.Stage.FINISHED;
201
- result.status = _allureJsCommons.Status.PASSED;
202
- }, testUuid);
166
+ var fixtureUuid = this.runContext.executables.pop();
167
+ var status = typeof error === "string" ? _allureJsCommons.Status.BROKEN : (0, _sdk.getStatusFromError)(error);
168
+ this.runtime.updateFixture(fixtureUuid, r => {
169
+ r.status = status;
170
+ r.statusDetails = {
171
+ message: typeof error === "string" ? error : error.message,
172
+ trace: typeof error === "string" ? undefined : error.stack
173
+ };
174
+ r.stage = _allureJsCommons.Stage.FINISHED;
175
+ });
176
+ this.runtime.stopFixture(fixtureUuid);
177
+ }
178
+ function _startTest(test) {
179
+ var _test$startedAt;
180
+ var newTestSuitePath = (0, _utils.getTestPath)(test.parent);
181
+ var newTestFullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, test);
182
+ if (this.testPlan && !(0, _utils.isTestPresentInTestPlan)(newTestFullName, this.testPlan)) {
183
+ test.mode = "skip";
184
+ this.runContext.skippedTestsFullNamesByTestPlan.push(newTestFullName);
185
+ return;
203
186
  }
204
- handleTestFail(test) {
205
- var testUuid = this.getTestUuid(test);
206
- if (!testUuid) {
207
- return;
187
+ var threadLabel = ALLURE_THREAD_NAME || JEST_WORKER_ID || _nodeProcess.default.pid.toString();
188
+ var hostLabel = ALLURE_HOST_NAME || hostname;
189
+ var packageLabel = (0, _nodePath.dirname)(this.testPath).split(_nodePath.sep).join(".");
190
+ _assertClassBrand(_Class_brand, this, _startScope).call(this);
191
+ var testUuid = this.runtime.startTest({
192
+ name: test.name,
193
+ fullName: newTestFullName,
194
+ start: (_test$startedAt = test.startedAt) !== null && _test$startedAt !== void 0 ? _test$startedAt : undefined,
195
+ labels: [{
196
+ name: _allureJsCommons.LabelName.LANGUAGE,
197
+ value: "javascript"
198
+ }, {
199
+ name: _allureJsCommons.LabelName.FRAMEWORK,
200
+ value: "jest"
201
+ }, {
202
+ name: _allureJsCommons.LabelName.PACKAGE,
203
+ value: packageLabel
204
+ }, ...(0, _reporter.getEnvironmentLabels)()]
205
+ }, this.runContext.scopes);
206
+ this.runtime.updateTest(testUuid, result => {
207
+ if (threadLabel) {
208
+ result.labels.push({
209
+ name: _allureJsCommons.LabelName.THREAD,
210
+ value: threadLabel
211
+ });
208
212
  }
209
-
210
- // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed
211
- var [error] = test.errors;
212
- var hasMultipleErrors = Array.isArray(error);
213
- var firstError = hasMultipleErrors ? error[0] : error;
214
- var details = (0, _sdk.getMessageAndTraceFromError)(firstError);
215
- var status = (0, _sdk.getStatusFromError)(firstError);
216
- this.runtime.updateTest(result => {
217
- result.stage = _allureJsCommons.Stage.FINISHED;
218
- result.status = status;
219
- result.statusDetails = _objectSpread({}, details);
220
- }, testUuid);
221
- }
222
- handleTestSkip(test) {
223
- var testUuid = this.getTestUuid(test);
224
- if (!testUuid) {
225
- return;
213
+ if (hostLabel) {
214
+ result.labels.push({
215
+ name: _allureJsCommons.LabelName.HOST,
216
+ value: hostLabel
217
+ });
226
218
  }
227
- this.runtime.updateTest(result => {
228
- result.stage = _allureJsCommons.Stage.PENDING;
229
- result.status = _allureJsCommons.Status.SKIPPED;
230
- }, testUuid);
231
- this.runtime.stopTest({
232
- uuid: testUuid
233
- });
234
- this.runtime.writeTest(testUuid);
235
- // TODO:
236
- this.allureUuidsByTestIds.delete((0, _utils.getTestId)((0, _utils.getTestPath)(test)));
219
+ result.labels.push(...(0, _reporter.getSuiteLabels)(newTestSuitePath));
220
+ });
221
+ this.runContext.executables.push(testUuid);
222
+ return testUuid;
223
+ }
224
+ function _stopTest(testUuid, duration) {
225
+ if (!testUuid) {
226
+ return;
237
227
  }
238
- handleTestDone(test) {
239
- var testUuid = this.getTestUuid(test);
240
- if (!testUuid) {
241
- return;
242
- }
243
- this.runtime.stopTest({
244
- uuid: testUuid
245
- });
246
- this.runtime.writeTest(testUuid);
247
- // TODO:
248
- this.allureUuidsByTestIds.delete((0, _utils.getTestId)((0, _utils.getTestPath)(test)));
228
+ this.runtime.stopTest(testUuid, {
229
+ duration
230
+ });
231
+ this.runtime.writeTest(testUuid);
232
+ }
233
+ function _handleTestStart(test) {
234
+ var testUuid = _assertClassBrand(_Class_brand, this, _startTest).call(this, test);
235
+ if (!testUuid) {
236
+ return;
249
237
  }
250
- handleTestTodo(test) {
251
- var testUuid = this.getTestUuid(test);
252
- if (!testUuid) {
253
- return;
254
- }
255
- this.runtime.updateTest(result => {
256
- result.stage = _allureJsCommons.Stage.PENDING;
257
- result.status = _allureJsCommons.Status.SKIPPED;
258
- }, testUuid);
259
- this.runtime.stopTest({
260
- uuid: testUuid
261
- });
262
- this.runtime.writeTest(testUuid);
263
- // TODO:
264
- this.allureUuidsByTestIds.delete((0, _utils.getTestId)((0, _utils.getTestPath)(test)));
238
+ this.runtime.updateTest(testUuid, result => {
239
+ result.stage = _allureJsCommons.Stage.RUNNING;
240
+ });
241
+ }
242
+ function _handleTestDone() {
243
+ _assertClassBrand(_Class_brand, this, _stopScope).call(this);
244
+ }
245
+ function _startScope() {
246
+ var scopeUuid = this.runtime.startScope();
247
+ this.runContext.scopes.push(scopeUuid);
248
+ }
249
+ function _stopScope() {
250
+ var scopeUuid = this.runContext.scopes.pop();
251
+ this.runtime.writeScope(scopeUuid);
252
+ }
253
+ function _handleTestPass(test) {
254
+ var _test$duration;
255
+ var testUuid = this.runContext.executables.pop();
256
+ if (!testUuid) {
257
+ return;
265
258
  }
266
- };
259
+ this.runtime.updateTest(testUuid, result => {
260
+ result.stage = _allureJsCommons.Stage.FINISHED;
261
+ result.status = _allureJsCommons.Status.PASSED;
262
+ });
263
+ _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration = test.duration) !== null && _test$duration !== void 0 ? _test$duration : 0);
264
+ }
265
+ function _handleTestFail(test) {
266
+ var _test$duration2;
267
+ var testUuid = this.runContext.executables.pop();
268
+ if (!testUuid) {
269
+ return;
270
+ }
271
+
272
+ // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed
273
+ var [error] = test.errors;
274
+ var hasMultipleErrors = Array.isArray(error);
275
+ var firstError = hasMultipleErrors ? error[0] : error;
276
+ var details = (0, _sdk.getMessageAndTraceFromError)(firstError);
277
+ var status = (0, _sdk.getStatusFromError)(firstError);
278
+ this.runtime.updateTest(testUuid, result => {
279
+ result.stage = _allureJsCommons.Stage.FINISHED;
280
+ result.status = status;
281
+ result.statusDetails = _objectSpread({}, details);
282
+ });
283
+ _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration2 = test.duration) !== null && _test$duration2 !== void 0 ? _test$duration2 : 0);
284
+ }
285
+ function _handleTestSkip(test) {
286
+ var _test$duration3;
287
+ var newTestFullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, test);
288
+ if (this.runContext.skippedTestsFullNamesByTestPlan.includes(newTestFullName)) {
289
+ return;
290
+ }
291
+ var testUuid = this.runContext.executables.pop();
292
+ if (!testUuid) {
293
+ return;
294
+ }
295
+ this.runtime.updateTest(testUuid, result => {
296
+ result.stage = _allureJsCommons.Stage.PENDING;
297
+ result.status = _allureJsCommons.Status.SKIPPED;
298
+ });
299
+ _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration3 = test.duration) !== null && _test$duration3 !== void 0 ? _test$duration3 : 0);
300
+ }
301
+ function _handleTestTodo(test) {
302
+ var _test$duration4;
303
+ var testUuid = this.runContext.executables.pop();
304
+ if (!testUuid) {
305
+ return;
306
+ }
307
+ this.runtime.updateTest(testUuid, result => {
308
+ result.stage = _allureJsCommons.Stage.PENDING;
309
+ result.status = _allureJsCommons.Status.SKIPPED;
310
+ });
311
+ _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration4 = test.duration) !== null && _test$duration4 !== void 0 ? _test$duration4 : 0);
312
+ }
313
+ function _handleRunFinish() {
314
+ this.runtime.writeEnvironmentInfo();
315
+ this.runtime.writeCategoriesDefinitions();
316
+ }
267
317
  };
268
318
  var _default = exports.default = createJestEnvironment;
269
319
  module.exports = exports.default;
@@ -1 +1 @@
1
- {"version":3,"file":"environmentFactory.js","names":["_nodeOs","_interopRequireDefault","require","_nodePath","_nodeProcess","_allureJsCommons","_interopRequireWildcard","allure","_sdk","_reporter","_runtime","_AllureJestTestRuntime","_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","ALLURE_HOST_NAME","ALLURE_THREAD_NAME","JEST_WORKER_ID","process","env","hostname","os","createJestEnvironment","Base","constructor","config","context","_config$projectConfig","Map","event","state","name","handleTestAdd","testName","test","concurrent","handleTestStart","handleTestTodo","handleTestPass","handleTestFail","handleTestSkip","handleTestDone","_ref","projectConfig","testEnvironmentOptions","resultsDir","testMode","restConfig","runtime","ReporterRuntime","writer","MessageWriter","FileSystemWriter","testPath","replace","globalConfig","rootDir","sep","testRuntime","AllureJestTestRuntime","global","setGlobalTestRuntime","setup","teardown","handleAllureRuntimeMessage","payload","testUuid","getTestUuid","currentTestName","parent","applyRuntimeMessages","message","getTestPath","currentTestId","getTestId","allureUuidsByTestIds","console","error","concat","undefined","currentDescribeBlock","newTestSuitesPath","newTestPath","newTestId","threadLabel","pid","toString","hostLabel","packageLabel","dirname","split","join","startTest","fullName","labels","LabelName","LANGUAGE","FRAMEWORK","PACKAGE","updateTest","result","THREAD","HOST","getSuitesLabels","stage","Stage","RUNNING","FINISHED","status","Status","PASSED","errors","hasMultipleErrors","Array","isArray","firstError","details","getMessageAndTraceFromError","getStatusFromError","statusDetails","PENDING","SKIPPED","stopTest","uuid","writeTest","delete","_default","exports","module"],"sources":["../../src/environmentFactory.ts"],"sourcesContent":["import type { EnvironmentContext, JestEnvironment } from \"@jest/environment\";\nimport type { Circus } from \"@jest/types\";\nimport os from \"node:os\";\nimport { dirname, sep } from \"node:path\";\nimport process from \"node:process\";\nimport * as allure from \"allure-js-commons\";\nimport { LabelName, Stage, Status } from \"allure-js-commons\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport { getMessageAndTraceFromError, getStatusFromError } from \"allure-js-commons/sdk\";\nimport { FileSystemWriter, MessageWriter, ReporterRuntime, getSuitesLabels } from \"allure-js-commons/sdk/reporter\";\nimport { setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport { AllureJestTestRuntime } from \"./AllureJestTestRuntime.js\";\nimport type { AllureJestConfig, AllureJestEnvironment } from \"./model.js\";\nimport { getTestId, getTestPath } from \"./utils.js\";\n\nconst { ALLURE_HOST_NAME, ALLURE_THREAD_NAME, JEST_WORKER_ID } = process.env;\nconst hostname = os.hostname();\n\nconst createJestEnvironment = <T extends typeof JestEnvironment>(Base: T): T => {\n // @ts-expect-error (ts(2545)) Incorrect assumption about a mixin class: https://github.com/microsoft/TypeScript/issues/37142\n return class extends Base {\n testPath: string;\n runtime: ReporterRuntime;\n allureUuidsByTestIds: Map<string, string> = new Map();\n\n constructor(config: AllureJestConfig, context: EnvironmentContext) {\n super(config, context);\n\n const {\n resultsDir = \"allure-results\",\n testMode = false,\n ...restConfig\n } = config?.projectConfig?.testEnvironmentOptions || {};\n\n this.runtime = new ReporterRuntime({\n ...restConfig,\n writer: testMode\n ? new MessageWriter()\n : new FileSystemWriter({\n resultsDir,\n }),\n });\n this.testPath = context.testPath.replace(config.globalConfig.rootDir, \"\").replace(sep, \"\");\n\n // @ts-ignore\n const testRuntime = new AllureJestTestRuntime(this as AllureJestEnvironment, this.global);\n\n // @ts-ignore\n this.global.allure = allure;\n\n setGlobalTestRuntime(testRuntime);\n }\n\n setup() {\n return super.setup();\n }\n\n teardown() {\n return super.teardown();\n }\n\n handleAllureRuntimeMessage(payload: { currentTestName: string; message: RuntimeMessage }) {\n const testUuid = this.getTestUuid({\n name: payload.currentTestName,\n // little hack because first element in the path will be always ommited\n parent: { name: \"ROOT_DESCRIBE_BLOCK\" },\n } as Circus.TestEntry)!;\n\n this.runtime.applyRuntimeMessages([payload.message], { testUuid });\n }\n\n private getTestUuid(test: Circus.TestEntry) {\n const testPath = getTestPath(test);\n const currentTestId = getTestId(testPath);\n const testUuid = this.allureUuidsByTestIds.get(currentTestId);\n\n if (!testUuid) {\n // eslint-disable-next-line no-console\n console.error(`Can't find \"${currentTestId}\" test while tried to start it!`);\n return undefined;\n }\n\n return testUuid;\n }\n\n handleTestEvent = (event: Circus.Event, state: Circus.State) => {\n switch (event.name) {\n case \"test_retry\":\n this.handleTestAdd({\n testName: event.test.name,\n concurrent: event.test.concurrent,\n state,\n });\n break;\n case \"add_test\":\n this.handleTestAdd({\n testName: event.testName,\n concurrent: event.concurrent,\n state,\n });\n break;\n case \"test_start\":\n this.handleTestStart(event.test);\n break;\n case \"test_todo\":\n this.handleTestTodo(event.test);\n break;\n case \"test_fn_success\":\n this.handleTestPass(event.test);\n break;\n case \"test_fn_failure\":\n this.handleTestFail(event.test);\n break;\n case \"test_skip\":\n this.handleTestSkip(event.test);\n break;\n case \"test_done\":\n this.handleTestDone(event.test);\n break;\n default:\n break;\n }\n };\n\n private handleTestAdd(payload: { testName: string; concurrent: boolean; state: Circus.State }) {\n const { testName, state } = payload;\n const { currentDescribeBlock } = state;\n const newTestSuitesPath = getTestPath(currentDescribeBlock);\n const newTestPath = newTestSuitesPath.concat(testName);\n const newTestId = getTestId(newTestPath);\n const threadLabel = ALLURE_THREAD_NAME || JEST_WORKER_ID || process.pid.toString();\n const hostLabel = ALLURE_HOST_NAME || hostname;\n const packageLabel = dirname(this.testPath).split(sep).join(\".\");\n const testUuid = this.runtime.startTest({\n name: testName,\n fullName: newTestId,\n labels: [\n {\n name: LabelName.LANGUAGE,\n value: \"javascript\",\n },\n {\n name: LabelName.FRAMEWORK,\n value: \"jest\",\n },\n {\n name: LabelName.PACKAGE,\n value: packageLabel,\n },\n ],\n });\n\n this.runtime.updateTest((result) => {\n if (threadLabel) {\n result.labels.push({ name: LabelName.THREAD, value: threadLabel });\n }\n\n if (hostLabel) {\n result.labels.push({ name: LabelName.HOST, value: hostLabel });\n }\n\n result.labels.push(...getSuitesLabels(newTestSuitesPath));\n }, testUuid);\n\n /**\n * If user have some tests with the same name, reporter will throw an error due the test with\n * the same name could be removed from the running tests, so better to throw an explicit error\n */\n if (this.allureUuidsByTestIds.has(newTestId)) {\n // eslint-disable-next-line no-console\n console.error(\n `Test \"${newTestId}\" has been already initialized! To continue with reporting, please rename the test.`,\n );\n return;\n }\n\n this.allureUuidsByTestIds.set(newTestId, testUuid as string);\n }\n\n private handleTestStart(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.RUNNING;\n }, testUuid);\n }\n\n private handleTestPass(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.PASSED;\n }, testUuid);\n }\n\n private handleTestFail(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed\n const [error] = test.errors;\n const hasMultipleErrors = Array.isArray(error);\n const firstError: Error = hasMultipleErrors ? error[0] : error;\n const details = getMessageAndTraceFromError(firstError);\n const status = getStatusFromError(firstError);\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.FINISHED;\n result.status = status;\n result.statusDetails = {\n ...details,\n };\n }, testUuid);\n }\n\n private handleTestSkip(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.PENDING;\n result.status = Status.SKIPPED;\n }, testUuid);\n this.runtime.stopTest({ uuid: testUuid });\n this.runtime.writeTest(testUuid);\n // TODO:\n this.allureUuidsByTestIds.delete(getTestId(getTestPath(test)));\n }\n\n private handleTestDone(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.stopTest({ uuid: testUuid });\n this.runtime.writeTest(testUuid);\n // TODO:\n this.allureUuidsByTestIds.delete(getTestId(getTestPath(test)));\n }\n\n private handleTestTodo(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.PENDING;\n result.status = Status.SKIPPED;\n }, testUuid);\n\n this.runtime.stopTest({ uuid: testUuid });\n this.runtime.writeTest(testUuid);\n // TODO:\n this.allureUuidsByTestIds.delete(getTestId(getTestPath(test)));\n }\n };\n};\n\nexport default createJestEnvironment;\n"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,gBAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAA4C,IAAAK,MAAA,GAAAF,gBAAA;AAG5C,IAAAG,IAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,sBAAA,GAAAT,OAAA;AAEA,IAAAU,MAAA,GAAAV,OAAA;AAAoD,IAAAW,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA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IAAI,CAAClB,OAAO,CAAC4E,SAAS,CAAC1D,QAAQ,CAAC;MAChC;MACA,IAAI,CAACS,oBAAoB,CAACkD,MAAM,CAAC,IAAAnD,gBAAS,EAAC,IAAAF,kBAAW,EAACtC,IAAI,CAAC,CAAC,CAAC;IAChE;EACF,CAAC;AACH,CAAC;AAAC,IAAA4F,QAAA,GAAAC,OAAA,CAAA3J,OAAA,GAEakD,qBAAqB;AAAA0G,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA3J,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"environmentFactory.js","names":["_nodeOs","_interopRequireDefault","require","_nodePath","_nodeProcess","_allureJsCommons","_interopRequireWildcard","allure","_sdk","_reporter","_runtime","_AllureJestTestRuntime","_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","_classPrivateMethodInitSpec","_checkPrivateRedeclaration","add","TypeError","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","String","Number","_assertClassBrand","ALLURE_HOST_NAME","ALLURE_THREAD_NAME","JEST_WORKER_ID","process","env","hostname","os","createJestEnvironment","Base","_Class_brand","WeakSet","constructor","config","context","executables","steps","scopes","skippedTestsFullNamesByTestPlan","event","name","_handleHookStart","hook","_handleHookPass","_handleHookFail","error","_handleSuiteStart","_handleSuiteEnd","_handleTestStart","test","_handleTestDone","_handleTestTodo","_handleTestPass","_handleTestFail","_handleTestSkip","_handleRunFinish","projectConfig","_ref","testEnvironmentOptions","resultsDir","restConfig","runtime","ReporterRuntime","writer","createDefaultWriter","testPath","replace","rootDir","sep","testPlan","parseTestPlan","testRuntime","AllureJestTestRuntime","global","setGlobalTestRuntime","setup","teardown","handleAllureRuntimeMessage","message","executableUuid","last","runContext","applyRuntimeMessages","_getTestFullName","newTestSuitePath","getTestPath","parent","newTestPath","concat","newTestId","getTestId","_startScope","_stopScope","shouldHookBeSkipped","scopeUuid","fixtureUuid","startFixture","type","pop","updateFixture","status","Status","PASSED","stage","Stage","FINISHED","stopFixture","BROKEN","getStatusFromError","statusDetails","trace","undefined","stack","_startTest","_test$startedAt","newTestFullName","isTestPresentInTestPlan","mode","threadLabel","pid","toString","hostLabel","packageLabel","dirname","split","join","testUuid","startTest","fullName","start","startedAt","labels","LabelName","LANGUAGE","FRAMEWORK","PACKAGE","getEnvironmentLabels","updateTest","result","THREAD","HOST","getSuiteLabels","_stopTest","duration","stopTest","writeTest","RUNNING","startScope","writeScope","_test$duration","_test$duration2","errors","hasMultipleErrors","Array","isArray","firstError","details","getMessageAndTraceFromError","_test$duration3","includes","PENDING","SKIPPED","_test$duration4","writeEnvironmentInfo","writeCategoriesDefinitions","_default","exports","module"],"sources":["../../src/environmentFactory.ts"],"sourcesContent":["import type { EnvironmentContext, JestEnvironment, JestEnvironmentConfig } from \"@jest/environment\";\nimport type { Circus } from \"@jest/types\";\nimport os from \"node:os\";\nimport { dirname, sep } from \"node:path\";\nimport process from \"node:process\";\nimport * as allure from \"allure-js-commons\";\nimport { LabelName, Stage, Status } from \"allure-js-commons\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport { getMessageAndTraceFromError, getStatusFromError } from \"allure-js-commons/sdk\";\nimport type { TestPlanV1 } from \"allure-js-commons/sdk\";\nimport {\n ReporterRuntime,\n createDefaultWriter,\n getEnvironmentLabels,\n getSuiteLabels,\n parseTestPlan,\n} from \"allure-js-commons/sdk/reporter\";\nimport { setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport { AllureJestTestRuntime } from \"./AllureJestTestRuntime.js\";\nimport type { AllureJestConfig, AllureJestEnvironment, AllureJestProjectConfig, RunContext } from \"./model.js\";\nimport { getTestId, getTestPath, isTestPresentInTestPlan, last, shouldHookBeSkipped } from \"./utils.js\";\n\nconst { ALLURE_HOST_NAME, ALLURE_THREAD_NAME, JEST_WORKER_ID } = process.env;\nconst hostname = os.hostname();\n\nconst createJestEnvironment = <T extends typeof JestEnvironment>(Base: T): T => {\n // @ts-expect-error (ts(2545)) Incorrect assumption about a mixin class: https://github.com/microsoft/TypeScript/issues/37142\n return class extends Base {\n testPath: string;\n testPlan?: TestPlanV1;\n runtime: ReporterRuntime;\n runContext: RunContext = {\n executables: [],\n steps: [],\n scopes: [],\n skippedTestsFullNamesByTestPlan: [],\n };\n\n // config is AllureJestConfig in Jest v28 or greater. In older versions\n // it's AllureJestProjectConfig. See https://github.com/jestjs/jest/pull/12461\n constructor(config: AllureJestConfig | AllureJestProjectConfig, context: EnvironmentContext) {\n super(config as JestEnvironmentConfig, context);\n\n const projectConfig = \"projectConfig\" in config ? config.projectConfig : config;\n const { resultsDir, ...restConfig } = projectConfig?.testEnvironmentOptions || {};\n\n this.runtime = new ReporterRuntime({\n ...restConfig,\n writer: createDefaultWriter({ resultsDir }),\n });\n this.testPath = context.testPath.replace(projectConfig.rootDir, \"\").replace(sep, \"\");\n this.testPlan = parseTestPlan();\n\n // @ts-ignore\n const testRuntime = new AllureJestTestRuntime(this as AllureJestEnvironment, this.global);\n\n // @ts-ignore\n this.global.allure = allure;\n\n setGlobalTestRuntime(testRuntime);\n }\n\n setup() {\n return super.setup();\n }\n\n teardown() {\n return super.teardown();\n }\n\n handleAllureRuntimeMessage(message: RuntimeMessage) {\n const executableUuid = last(this.runContext.executables);\n\n this.runtime.applyRuntimeMessages(executableUuid, [message]);\n }\n\n handleTestEvent = (event: Circus.Event) => {\n switch (event.name) {\n case \"hook_start\":\n this.#handleHookStart(event.hook);\n break;\n case \"hook_success\":\n this.#handleHookPass(event.hook);\n break;\n case \"hook_failure\":\n this.#handleHookFail(event.hook, event.error);\n break;\n case \"run_describe_start\":\n this.#handleSuiteStart();\n break;\n case \"run_describe_finish\":\n this.#handleSuiteEnd();\n break;\n case \"test_start\":\n this.#handleTestStart(event.test);\n break;\n case \"test_done\":\n this.#handleTestDone();\n break;\n case \"test_todo\":\n this.#handleTestTodo(event.test);\n break;\n case \"test_fn_success\":\n this.#handleTestPass(event.test);\n break;\n case \"test_fn_failure\":\n this.#handleTestFail(event.test);\n break;\n case \"test_skip\":\n this.#handleTestSkip(event.test);\n break;\n case \"run_finish\":\n this.#handleRunFinish();\n break;\n default:\n break;\n }\n };\n\n #getTestFullName(test: Circus.TestEntry) {\n const newTestSuitePath = getTestPath(test.parent);\n const newTestPath = newTestSuitePath.concat(test.name);\n const newTestId = getTestId(newTestPath);\n\n return `${this.testPath}#${newTestId}`;\n }\n\n #handleSuiteStart() {\n this.#startScope();\n }\n\n #handleSuiteEnd() {\n this.#stopScope();\n }\n\n #handleHookStart(hook: Circus.Hook) {\n if (shouldHookBeSkipped(hook)) {\n return;\n }\n\n const scopeUuid = last(this.runContext.scopes);\n const fixtureUuid = this.runtime.startFixture(scopeUuid, /after/i.test(hook.type) ? \"after\" : \"before\", {\n name: hook.type,\n })!;\n\n this.runContext.executables.push(fixtureUuid);\n }\n\n #handleHookPass(hook: Circus.Hook) {\n if (shouldHookBeSkipped(hook)) {\n return;\n }\n\n const fixtureUuid = this.runContext.executables.pop()!;\n\n this.runtime.updateFixture(fixtureUuid, (r) => {\n r.status = Status.PASSED;\n r.stage = Stage.FINISHED;\n });\n this.runtime.stopFixture(fixtureUuid);\n }\n\n #handleHookFail(hook: Circus.Hook, error: string | Circus.Exception) {\n if (shouldHookBeSkipped(hook)) {\n return;\n }\n\n const fixtureUuid = this.runContext.executables.pop()!;\n const status = typeof error === \"string\" ? Status.BROKEN : getStatusFromError(error as Error);\n\n this.runtime.updateFixture(fixtureUuid, (r) => {\n r.status = status;\n r.statusDetails = {\n message: typeof error === \"string\" ? error : error.message,\n trace: typeof error === \"string\" ? undefined : error.stack,\n };\n r.stage = Stage.FINISHED;\n });\n this.runtime.stopFixture(fixtureUuid);\n }\n\n #startTest(test: Circus.TestEntry) {\n const newTestSuitePath = getTestPath(test.parent);\n const newTestFullName = this.#getTestFullName(test);\n\n if (this.testPlan && !isTestPresentInTestPlan(newTestFullName, this.testPlan)) {\n test.mode = \"skip\";\n this.runContext.skippedTestsFullNamesByTestPlan.push(newTestFullName);\n return;\n }\n\n const threadLabel = ALLURE_THREAD_NAME || JEST_WORKER_ID || process.pid.toString();\n const hostLabel = ALLURE_HOST_NAME || hostname;\n const packageLabel = dirname(this.testPath).split(sep).join(\".\");\n\n this.#startScope();\n const testUuid = this.runtime.startTest(\n {\n name: test.name,\n fullName: newTestFullName,\n start: test.startedAt ?? undefined,\n labels: [\n {\n name: LabelName.LANGUAGE,\n value: \"javascript\",\n },\n {\n name: LabelName.FRAMEWORK,\n value: \"jest\",\n },\n {\n name: LabelName.PACKAGE,\n value: packageLabel,\n },\n ...getEnvironmentLabels(),\n ],\n },\n this.runContext.scopes,\n );\n\n this.runtime.updateTest(testUuid, (result) => {\n if (threadLabel) {\n result.labels.push({ name: LabelName.THREAD, value: threadLabel });\n }\n\n if (hostLabel) {\n result.labels.push({ name: LabelName.HOST, value: hostLabel });\n }\n\n result.labels.push(...getSuiteLabels(newTestSuitePath));\n });\n\n this.runContext.executables.push(testUuid);\n\n return testUuid;\n }\n\n #stopTest(testUuid: string, duration: number) {\n if (!testUuid) {\n return;\n }\n\n this.runtime.stopTest(testUuid, { duration });\n this.runtime.writeTest(testUuid);\n }\n\n #handleTestStart(test: Circus.TestEntry) {\n const testUuid = this.#startTest(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.RUNNING;\n });\n }\n\n #handleTestDone() {\n this.#stopScope();\n }\n\n #startScope() {\n const scopeUuid = this.runtime.startScope();\n\n this.runContext.scopes.push(scopeUuid);\n }\n\n #stopScope() {\n const scopeUuid = this.runContext.scopes.pop()!;\n\n this.runtime.writeScope(scopeUuid);\n }\n\n #handleTestPass(test: Circus.TestEntry) {\n const testUuid = this.runContext.executables.pop();\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.PASSED;\n });\n this.#stopTest(testUuid, test.duration ?? 0);\n }\n\n #handleTestFail(test: Circus.TestEntry) {\n const testUuid = this.runContext.executables.pop();\n\n if (!testUuid) {\n return;\n }\n\n // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed\n const [error] = test.errors;\n const hasMultipleErrors = Array.isArray(error);\n const firstError: Error = hasMultipleErrors ? error[0] : error;\n const details = getMessageAndTraceFromError(firstError);\n const status = getStatusFromError(firstError);\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = status;\n result.statusDetails = {\n ...details,\n };\n });\n this.#stopTest(testUuid, test.duration ?? 0);\n }\n\n #handleTestSkip(test: Circus.TestEntry) {\n const newTestFullName = this.#getTestFullName(test);\n\n if (this.runContext.skippedTestsFullNamesByTestPlan.includes(newTestFullName)) {\n return;\n }\n\n const testUuid = this.runContext.executables.pop();\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.PENDING;\n result.status = Status.SKIPPED;\n });\n this.#stopTest(testUuid, test.duration ?? 0);\n }\n\n #handleTestTodo(test: Circus.TestEntry) {\n const testUuid = this.runContext.executables.pop();\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.PENDING;\n result.status = Status.SKIPPED;\n });\n this.#stopTest(testUuid, test.duration ?? 0);\n }\n\n #handleRunFinish() {\n this.runtime.writeEnvironmentInfo();\n this.runtime.writeCategoriesDefinitions();\n }\n };\n};\n\nexport default createJestEnvironment;\n"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,O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