allure-jest 3.14.0 → 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,7 +46,7 @@ npm install -D allure-jest
46
46
 
47
47
  Install Allure Report separately when you want to render the generated `allure-results`:
48
48
 
49
- - follow the [Allure Report 2 installation guide](https://allurereport.org/docs/install/) to use the `allure` CLI
49
+ - follow the [Allure Report 2 installation guide](https://allurereport.org/docs/v2/install/) to use the `allure` CLI
50
50
  - or install Allure Report 3 with `npm install -D allure` to use `npx allure`
51
51
 
52
52
  ## Supported versions and platforms
@@ -55,7 +55,7 @@ Install Allure Report separately when you want to render the generated `allure-r
55
55
  - `jest-circus >= 24.8.0`
56
56
  - matching Jest CLI and environment packages `>= 24.8.0`
57
57
  - Linux, macOS, and Windows wherever Jest supports Node.js
58
- - this repository is validated in CI on Node.js 20 and 22
58
+ - this repository is validated in CI on Node.js 24 and 26
59
59
 
60
60
  ## Usage
61
61
 
@@ -164,8 +164,8 @@ The sync facade is strict-sync only: `allure.step()` must finish synchronously a
164
164
  To use Allure-Jest with custom environments, you can use the `createJestEnvironment` helper function:
165
165
 
166
166
  ```js
167
- import CustomTestEnvironment from "jest-environment-custom";
168
167
  import { createJestEnvironment } from "allure-jest/factory";
168
+ import CustomTestEnvironment from "jest-environment-custom";
169
169
 
170
170
  export default createJestEnvironment(CustomTestEnvironment);
171
171
  ```
@@ -15,25 +15,33 @@ var _AllureJestTestRuntime = require("./AllureJestTestRuntime.js");
15
15
  var _utils = require("./utils.js");
16
16
  var _excluded = ["resultsDir"];
17
17
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
18
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
19
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
20
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
21
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
22
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
23
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
18
24
  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; }
19
25
  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; }
20
26
  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], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
21
27
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
22
28
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
29
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
23
30
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
24
31
  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; }
25
32
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
26
33
  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); }
34
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
27
35
  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
36
  var createJestEnvironment = Base => {
29
- var _Class_brand;
37
+ var _testContexts, _Class_brand;
30
38
  // @ts-expect-error (ts(2545)) Incorrect assumption about a mixin class: https://github.com/microsoft/TypeScript/issues/37142
31
- return _Class_brand = /*#__PURE__*/new WeakSet(), class extends Base {
39
+ return _testContexts = /*#__PURE__*/new WeakMap(), _Class_brand = /*#__PURE__*/new WeakSet(), class extends Base {
32
40
  // config is AllureJestConfig in Jest v28 or greater. In older versions
33
41
  // it's AllureJestProjectConfig. See https://github.com/jestjs/jest/pull/12461
34
- constructor(config, context) {
42
+ constructor(config, _context) {
35
43
  var _this$handleTestEvent;
36
- super(config, context);
44
+ super(config, _context);
37
45
  _classPrivateMethodInitSpec(this, _Class_brand);
38
46
  _defineProperty(this, "testPath", void 0);
39
47
  _defineProperty(this, "testPlan", void 0);
@@ -44,11 +52,16 @@ var createJestEnvironment = Base => {
44
52
  scopes: [],
45
53
  skippedTestsFullNamesByTestPlan: []
46
54
  });
55
+ _classPrivateFieldInitSpec(this, _testContexts, new Map());
47
56
  var handleTestEvent = (_this$handleTestEvent = this.handleTestEvent) === null || _this$handleTestEvent === void 0 ? void 0 : _this$handleTestEvent.bind(this);
48
57
 
49
58
  // Preserve any event handler defined by the base or custom environment.
50
59
  this.handleTestEvent = (event, state) => {
51
- var handleAllureEvent = () => _assertClassBrand(_Class_brand, this, _handleTestEvent).call(this, event, state);
60
+ var _this$global$expect$g, _this$global$expect, _this$global$expect$g2, _this$global$expect$g3;
61
+ // Capture the hook owner before a custom handler can yield or change
62
+ // Circus's shared cursor. Runtime messages use the same native identity.
63
+ var hookTest = event.name === "hook_start" ? (_this$global$expect$g = (_this$global$expect = this.global.expect) === null || _this$global$expect === void 0 || (_this$global$expect$g2 = (_this$global$expect$g3 = _this$global$expect.getState()).currentTestIdentity) === null || _this$global$expect$g2 === void 0 ? void 0 : _this$global$expect$g2.call(_this$global$expect$g3)) !== null && _this$global$expect$g !== void 0 ? _this$global$expect$g : state.currentlyRunningTest : undefined;
64
+ var handleAllureEvent = () => _assertClassBrand(_Class_brand, this, _handleTestEvent).call(this, event, hookTest);
52
65
 
53
66
  // Keep Allure's lifecycle in sync even if the custom environment fails,
54
67
  // then rethrow the original error so Jest keeps its native behavior.
@@ -65,17 +78,17 @@ var createJestEnvironment = Base => {
65
78
  };
66
79
  var projectConfig = "projectConfig" in config ? config.projectConfig : config;
67
80
  var _ref = (projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.testEnvironmentOptions) || {},
68
- {
69
- resultsDir
70
- } = _ref,
81
+ resultsDir = _ref.resultsDir,
71
82
  restConfig = _objectWithoutProperties(_ref, _excluded);
72
83
  this.runtime = new _reporter.ReporterRuntime(_objectSpread(_objectSpread({}, restConfig), {}, {
73
84
  writer: (0, _reporter.createDefaultWriter)({
74
85
  resultsDir
75
86
  })
76
87
  }));
77
- this.testPath = (0, _nodePath.relative)(projectConfig.rootDir, context.testPath);
78
- this.testPlan = (0, _reporter.parseTestPlan)();
88
+ this.testPath = (0, _nodePath.relative)(projectConfig.rootDir, _context.testPath);
89
+ this.testPlan = (0, _reporter.parseTestPlan)({
90
+ enableExcludedTests: true
91
+ });
79
92
 
80
93
  // @ts-ignore
81
94
  var testRuntime = new _AllureJestTestRuntime.AllureJestTestRuntime(this, this.global);
@@ -91,7 +104,11 @@ var createJestEnvironment = Base => {
91
104
  return super.teardown();
92
105
  }
93
106
  handleAllureRuntimeMessage(message) {
94
- var executableUuid = (0, _utils.last)(this.runContext.executables);
107
+ var _this$global$expect2, _context$fixtureUuid, _ref2, _last;
108
+ var getIdentity = (_this$global$expect2 = this.global.expect) === null || _this$global$expect2 === void 0 ? void 0 : _this$global$expect2.getState().currentTestIdentity;
109
+ var identity = getIdentity === null || getIdentity === void 0 ? void 0 : getIdentity();
110
+ var context = getIdentity ? identity && _classPrivateFieldGet(_testContexts, this).get(identity) : (0, _utils.last)([..._classPrivateFieldGet(_testContexts, this).values()]);
111
+ var executableUuid = getIdentity && identity ? (_context$fixtureUuid = context === null || context === void 0 ? void 0 : context.fixtureUuid) !== null && _context$fixtureUuid !== void 0 ? _context$fixtureUuid : context === null || context === void 0 ? void 0 : context.uuid : (_ref2 = (_last = (0, _utils.last)(this.runContext.executables)) !== null && _last !== void 0 ? _last : context === null || context === void 0 ? void 0 : context.fixtureUuid) !== null && _ref2 !== void 0 ? _ref2 : context === null || context === void 0 ? void 0 : context.uuid;
95
112
  if (executableUuid) {
96
113
  this.runtime.applyRuntimeMessages(executableUuid, [message]);
97
114
  } else {
@@ -99,16 +116,16 @@ var createJestEnvironment = Base => {
99
116
  }
100
117
  }
101
118
  };
102
- function _handleTestEvent(event, _state) {
119
+ function _handleTestEvent(event, hookTest) {
103
120
  switch (event.name) {
104
121
  case "hook_start":
105
- _assertClassBrand(_Class_brand, this, _handleHookStart).call(this, event.hook);
122
+ _assertClassBrand(_Class_brand, this, _handleHookStart).call(this, event.hook, hookTest);
106
123
  break;
107
124
  case "hook_success":
108
- _assertClassBrand(_Class_brand, this, _handleHookPass).call(this, event.hook);
125
+ _assertClassBrand(_Class_brand, this, _handleHookPass).call(this, event.hook, event.test);
109
126
  break;
110
127
  case "hook_failure":
111
- _assertClassBrand(_Class_brand, this, _handleHookFail).call(this, event.hook, event.error);
128
+ _assertClassBrand(_Class_brand, this, _handleHookFail).call(this, event.hook, event.error, event.test);
112
129
  break;
113
130
  case "run_describe_start":
114
131
  _assertClassBrand(_Class_brand, this, _handleSuiteStart).call(this);
@@ -117,7 +134,22 @@ var createJestEnvironment = Base => {
117
134
  _assertClassBrand(_Class_brand, this, _handleSuiteEnd).call(this);
118
135
  break;
119
136
  case "test_start":
120
- _assertClassBrand(_Class_brand, this, _handleTestScopeStart).call(this);
137
+ if (this.testPlan) {
138
+ var _extractMetadataFromS = (0, _sdk.extractMetadataFromString)(event.test.name),
139
+ cleanTitle = _extractMetadataFromS.cleanTitle;
140
+ var fullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, event.test, cleanTitle);
141
+ if (!(0, _reporter.includedInTestPlan)(this.testPlan, {
142
+ fullName,
143
+ tags: [event.test.name]
144
+ }, {
145
+ enableExcludedTests: true
146
+ })) {
147
+ event.test.mode = "skip";
148
+ this.runContext.skippedTestsFullNamesByTestPlan.push(fullName);
149
+ break;
150
+ }
151
+ }
152
+ _assertClassBrand(_Class_brand, this, _handleTestScopeStart).call(this, event.test);
121
153
  break;
122
154
  case "test_fn_start":
123
155
  _assertClassBrand(_Class_brand, this, _handleTestStart).call(this, event.test);
@@ -160,32 +192,48 @@ var createJestEnvironment = Base => {
160
192
  function _handleSuiteEnd() {
161
193
  _assertClassBrand(_Class_brand, this, _stopScope).call(this);
162
194
  }
163
- function _handleHookStart(hook) {
195
+ function _handleHookStart(hook, test) {
196
+ var _context$scopeUuid;
164
197
  if ((0, _utils.shouldHookBeSkipped)(hook)) {
165
198
  return;
166
199
  }
167
- var scopeUuid = (0, _utils.last)(this.runContext.scopes);
200
+ var context = test && hook.type.endsWith("Each") ? _classPrivateFieldGet(_testContexts, this).get(test) : undefined;
201
+ var scopeUuid = (_context$scopeUuid = context === null || context === void 0 ? void 0 : context.scopeUuid) !== null && _context$scopeUuid !== void 0 ? _context$scopeUuid : (0, _utils.last)(this.runContext.scopes);
168
202
  var fixtureUuid = this.runtime.startFixture(scopeUuid, /after/i.test(hook.type) ? "after" : "before", {
169
203
  name: hook.type
170
204
  });
171
- this.runContext.executables.push(fixtureUuid);
205
+ if (context) {
206
+ context.fixtureUuid = fixtureUuid;
207
+ } else {
208
+ this.runContext.executables.push(fixtureUuid);
209
+ }
172
210
  }
173
- function _handleHookPass(hook) {
211
+ function _handleHookPass(hook, test) {
212
+ var _context$fixtureUuid2;
174
213
  if ((0, _utils.shouldHookBeSkipped)(hook)) {
175
214
  return;
176
215
  }
177
- var fixtureUuid = this.runContext.executables.pop();
216
+ var context = test ? _classPrivateFieldGet(_testContexts, this).get(test) : undefined;
217
+ var fixtureUuid = (_context$fixtureUuid2 = context === null || context === void 0 ? void 0 : context.fixtureUuid) !== null && _context$fixtureUuid2 !== void 0 ? _context$fixtureUuid2 : this.runContext.executables.pop();
218
+ if (context) {
219
+ delete context.fixtureUuid;
220
+ }
178
221
  this.runtime.updateFixture(fixtureUuid, r => {
179
222
  r.status = _allureJsCommons.Status.PASSED;
180
223
  r.stage = _allureJsCommons.Stage.FINISHED;
181
224
  });
182
225
  this.runtime.stopFixture(fixtureUuid);
183
226
  }
184
- function _handleHookFail(hook, error) {
227
+ function _handleHookFail(hook, error, test) {
228
+ var _context$fixtureUuid3;
185
229
  if ((0, _utils.shouldHookBeSkipped)(hook)) {
186
230
  return;
187
231
  }
188
- var fixtureUuid = this.runContext.executables.pop();
232
+ var context = test ? _classPrivateFieldGet(_testContexts, this).get(test) : undefined;
233
+ var fixtureUuid = (_context$fixtureUuid3 = context === null || context === void 0 ? void 0 : context.fixtureUuid) !== null && _context$fixtureUuid3 !== void 0 ? _context$fixtureUuid3 : this.runContext.executables.pop();
234
+ if (context) {
235
+ delete context.fixtureUuid;
236
+ }
189
237
  var status = typeof error === "string" ? _allureJsCommons.Status.BROKEN : (0, _sdk.getStatusFromError)(error);
190
238
  var statusDetails = typeof error === "string" ? {
191
239
  message: error
@@ -209,22 +257,14 @@ var createJestEnvironment = Base => {
209
257
  var projectName = (0, _reporter.getProjectName)();
210
258
  var baseTitlePath = fsPath.concat(newTestSuitePath);
211
259
  var titlePath = projectName ? [projectName, ...baseTitlePath] : baseTitlePath;
212
- var {
213
- cleanTitle,
214
- labels,
215
- links
216
- } = (0, _sdk.extractMetadataFromString)(test.name);
260
+ var _extractMetadataFromS2 = (0, _sdk.extractMetadataFromString)(test.name),
261
+ cleanTitle = _extractMetadataFromS2.cleanTitle,
262
+ labels = _extractMetadataFromS2.labels,
263
+ links = _extractMetadataFromS2.links;
217
264
  var legacyTestId = (0, _utils.getTestId)(newTestSuitePath.concat(cleanTitle));
218
265
  var legacyFullName = "".concat((0, _reporter.getPosixPath)(this.testPath), "#").concat(legacyTestId);
219
266
  var newTestFullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, test, cleanTitle);
220
- if (this.testPlan && !(0, _reporter.includedInTestPlan)(this.testPlan, {
221
- fullName: newTestFullName,
222
- tags: [test.name]
223
- })) {
224
- test.mode = "skip";
225
- this.runContext.skippedTestsFullNamesByTestPlan.push(newTestFullName);
226
- return;
227
- }
267
+ var context = _assertClassBrand(_Class_brand, this, _handleTestScopeStart).call(this, test);
228
268
  var testUuid = this.runtime.startTest({
229
269
  name: cleanTitle,
230
270
  fullName: newTestFullName,
@@ -233,21 +273,28 @@ var createJestEnvironment = Base => {
233
273
  labels: [(0, _reporter.getLanguageLabel)(), (0, _reporter.getFrameworkLabel)("jest"), (0, _reporter.getPackageLabel)(this.testPath), (0, _reporter.getFallbackTestCaseIdLabel)((0, _reporter.md5)(legacyFullName)), (0, _reporter.getHostLabel)(), (0, _reporter.getThreadLabel)(_nodeProcess.env.JEST_WORKER_ID), ...(0, _reporter.getEnvironmentLabels)(), ...(0, _reporter.getSuiteLabels)(newTestSuitePath), ...labels],
234
274
  titlePath,
235
275
  links
236
- }, this.runContext.scopes);
237
- this.runContext.executables.push(testUuid);
276
+ }, [...this.runContext.scopes, context.scopeUuid]);
277
+ context.uuid = testUuid;
238
278
  return testUuid;
239
279
  }
240
- function _handleTestScopeStart() {
241
- _assertClassBrand(_Class_brand, this, _startScope).call(this);
280
+ function _handleTestScopeStart(test) {
281
+ var context = _classPrivateFieldGet(_testContexts, this).get(test);
282
+ if (!context) {
283
+ context = {
284
+ scopeUuid: this.runtime.startScope()
285
+ };
286
+ _classPrivateFieldGet(_testContexts, this).set(test, context);
287
+ }
288
+ return context;
242
289
  }
243
290
  function _handleTestScopeStop(test) {
244
- var testUuid = this.runContext.executables.pop();
291
+ var context = _classPrivateFieldGet(_testContexts, this).get(test);
292
+ var testUuid = context === null || context === void 0 ? void 0 : context.uuid;
245
293
  if (testUuid) {
246
294
  var _tr, _tr2;
247
- var {
248
- status,
249
- details
250
- } = _assertClassBrand(_Class_brand, this, _statusAndDetails).call(this, test.errors);
295
+ var _assertClassBrand$cal = _assertClassBrand(_Class_brand, this, _statusAndDetails).call(this, test.errors),
296
+ status = _assertClassBrand$cal.status,
297
+ details = _assertClassBrand$cal.details;
251
298
  var tr;
252
299
  this.runtime.updateTest(testUuid, result => {
253
300
  tr = result;
@@ -262,7 +309,10 @@ var createJestEnvironment = Base => {
262
309
  }
263
310
  this.runtime.writeTest(testUuid);
264
311
  }
265
- _assertClassBrand(_Class_brand, this, _stopScope).call(this);
312
+ if (context) {
313
+ this.runtime.writeScope(context.scopeUuid);
314
+ _classPrivateFieldGet(_testContexts, this).delete(test);
315
+ }
266
316
  }
267
317
  function _startScope() {
268
318
  var scopeUuid = this.runtime.startScope();
@@ -276,15 +326,15 @@ var createJestEnvironment = Base => {
276
326
  this.runtime.writeScope(scopeUuid);
277
327
  }
278
328
  function _handleTestPass(test) {
279
- var _test$duration;
280
- var testUuid = _assertClassBrand(_Class_brand, this, _currentExecutable).call(this);
329
+ var _classPrivateFieldGet2, _test$duration;
330
+ var testUuid = (_classPrivateFieldGet2 = _classPrivateFieldGet(_testContexts, this).get(test)) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.uuid;
281
331
  if (!testUuid) {
282
332
  return;
283
333
  }
284
334
  // @ts-ignore
285
- var {
286
- suppressedErrors = []
287
- } = this.global.expect.getState();
335
+ var _this$global$expect$g4 = this.global.expect.getState(),
336
+ _this$global$expect$g5 = _this$global$expect$g4.suppressedErrors,
337
+ suppressedErrors = _this$global$expect$g5 === void 0 ? [] : _this$global$expect$g5;
288
338
  var statusAndDetails = _assertClassBrand(_Class_brand, this, _statusAndDetails).call(this, suppressedErrors);
289
339
  this.runtime.updateTest(testUuid, result => {
290
340
  result.stage = _allureJsCommons.Stage.FINISHED;
@@ -296,8 +346,8 @@ var createJestEnvironment = Base => {
296
346
  });
297
347
  }
298
348
  function _handleTestFail(test) {
299
- var _test$duration2;
300
- var testUuid = _assertClassBrand(_Class_brand, this, _currentExecutable).call(this);
349
+ var _classPrivateFieldGet3, _test$duration2;
350
+ var testUuid = (_classPrivateFieldGet3 = _classPrivateFieldGet(_testContexts, this).get(test)) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.uuid;
301
351
  if (!testUuid) {
302
352
  return;
303
353
  }
@@ -313,8 +363,11 @@ var createJestEnvironment = Base => {
313
363
  });
314
364
  }
315
365
  function _handleTestSkip(test) {
316
- var newTestFullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, test);
366
+ var _extractMetadataFromS3 = (0, _sdk.extractMetadataFromString)(test.name),
367
+ cleanTitle = _extractMetadataFromS3.cleanTitle;
368
+ var newTestFullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, test, cleanTitle);
317
369
  if (this.runContext.skippedTestsFullNamesByTestPlan.includes(newTestFullName)) {
370
+ _assertClassBrand(_Class_brand, this, _handleTestScopeStop).call(this, test);
318
371
  return;
319
372
  }
320
373
 
@@ -350,12 +403,6 @@ var createJestEnvironment = Base => {
350
403
  this.runtime.writeEnvironmentInfo();
351
404
  this.runtime.writeCategoriesDefinitions();
352
405
  }
353
- function _currentExecutable() {
354
- if (this.runContext.executables.length === 0) {
355
- return undefined;
356
- }
357
- return this.runContext.executables[this.runContext.executables.length - 1];
358
- }
359
406
  function _statusAndDetails(errors) {
360
407
  if (errors.length === 0) {
361
408
  return {
@@ -365,7 +412,8 @@ var createJestEnvironment = Base => {
365
412
  }
366
413
 
367
414
  // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed
368
- var [error] = errors;
415
+ var _errors = _slicedToArray(errors, 1),
416
+ error = _errors[0];
369
417
  var hasMultipleErrors = Array.isArray(error);
370
418
  var exception = hasMultipleErrors ? error[0] : error;
371
419
  var firstError = _assertClassBrand(_Class_brand, this, _convertToError).call(this, exception);
@@ -1 +1 @@
1
- {"version":3,"file":"environmentFactory.js","names":["_nodePath","require","_nodeProcess","_allureJsCommons","_interopRequireWildcard","allure","_sdk","_reporter","_runtime","_AllureJestTestRuntime","_utils","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_objectWithoutProperties","_objectWithoutPropertiesLoose","indexOf","propertyIsEnumerable","_classPrivateMethodInitSpec","a","_checkPrivateRedeclaration","add","TypeError","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","String","Number","_assertClassBrand","createJestEnvironment","Base","_Class_brand","WeakSet","constructor","config","context","_this$handleTestEvent","executables","steps","scopes","skippedTestsFullNamesByTestPlan","handleTestEvent","bind","event","state","handleAllureEvent","_handleTestEvent","result","isPromise","Promise","resolve","finally","error","projectConfig","_ref","testEnvironmentOptions","resultsDir","restConfig","runtime","ReporterRuntime","writer","createDefaultWriter","testPath","relative","rootDir","testPlan","parseTestPlan","testRuntime","AllureJestTestRuntime","global","setGlobalTestRuntime","setup","teardown","handleAllureRuntimeMessage","message","executableUuid","last","runContext","applyRuntimeMessages","applyGlobalRuntimeMessages","_state","name","_handleHookStart","hook","_handleHookPass","_handleHookFail","_handleSuiteStart","_handleSuiteEnd","_handleTestScopeStart","_handleTestStart","test","_handleTestPass","_handleTestFail","_handleTestScopeStop","_handleTestSkip","_handleTestTodo","_handleRunFinish","_getTestFullName","testTitle","undefined","newTestSuitePath","getTestPath","parent","newTestPath","concat","newTestId","getTestId","projectName","getProjectName","fullNamePath","getPosixPath","fullNameBase","_startScope","_stopScope","shouldHookBeSkipped","scopeUuid","fixtureUuid","startFixture","type","pop","updateFixture","status","Status","PASSED","stage","Stage","FINISHED","stopFixture","BROKEN","getStatusFromError","statusDetails","getMessageAndTraceFromError","toGlobalErrorMessage","details","_test$startedAt","fsPath","split","sep","baseTitlePath","titlePath","cleanTitle","labels","links","extractMetadataFromString","legacyTestId","legacyFullName","newTestFullName","includedInTestPlan","fullName","tags","mode","testUuid","startTest","start","startedAt","RUNNING","getLanguageLabel","getFrameworkLabel","getPackageLabel","getFallbackTestCaseIdLabel","md5","getHostLabel","getThreadLabel","env","JEST_WORKER_ID","getEnvironmentLabels","getSuiteLabels","_tr","_tr2","_statusAndDetails","errors","tr","updateTest","writeTest","startScope","writeScope","_test$duration","_currentExecutable","suppressedErrors","expect","getState","statusAndDetails","stopTest","duration","_test$duration2","failing","FAILED","includes","SKIPPED","writeEnvironmentInfo","writeCategoriesDefinitions","hasMultipleErrors","Array","isArray","exception","firstError","_convertToError","secondError","stack","serialize","exports"],"sources":["../../src/environmentFactory.ts"],"sourcesContent":["import { relative, sep } from \"node:path\";\nimport { env } from \"node:process\";\n\nimport type { EnvironmentContext, JestEnvironment, JestEnvironmentConfig } from \"@jest/environment\";\nimport type { Circus } from \"@jest/types\";\nimport * as allure from \"allure-js-commons\";\nimport { Stage, Status, type StatusDetails, type TestResult } from \"allure-js-commons\";\nimport { type RuntimeMessage, type TestPlanV1, serialize } from \"allure-js-commons/sdk\";\nimport {\n extractMetadataFromString,\n getMessageAndTraceFromError,\n getStatusFromError,\n isPromise,\n toGlobalErrorMessage,\n} from \"allure-js-commons/sdk\";\nimport {\n ReporterRuntime,\n createDefaultWriter,\n getEnvironmentLabels,\n getFallbackTestCaseIdLabel,\n getFrameworkLabel,\n getHostLabel,\n getLanguageLabel,\n getPackageLabel,\n getPosixPath,\n getProjectName,\n getSuiteLabels,\n getThreadLabel,\n includedInTestPlan,\n md5,\n parseTestPlan,\n} from \"allure-js-commons/sdk/reporter\";\nimport { setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\n\nimport { AllureJestTestRuntime } from \"./AllureJestTestRuntime.js\";\nimport type { AllureJestConfig, AllureJestEnvironment, AllureJestProjectConfig, RunContext } from \"./model.js\";\nimport { getTestId, getTestPath, last, shouldHookBeSkipped } from \"./utils.js\";\n\ntype JestEnvironmentConstructor = new (...args: any[]) => any;\ntype JestEventHandler = NonNullable<JestEnvironment[\"handleTestEvent\"]>;\ntype CallableJestEventHandler = (event: any, state: Circus.State) => void | PromiseLike<void> | undefined;\n\nconst createJestEnvironment = <T extends JestEnvironmentConstructor>(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 handleTestEvent = this.handleTestEvent?.bind(this) as CallableJestEventHandler | undefined;\n\n // Preserve any event handler defined by the base or custom environment.\n this.handleTestEvent = ((event: any, state: Circus.State) => {\n const handleAllureEvent = () => this.#handleTestEvent(event as Circus.Event, state as Circus.State);\n\n // Keep Allure's lifecycle in sync even if the custom environment fails,\n // then rethrow the original error so Jest keeps its native behavior.\n try {\n const result = handleTestEvent?.(event, state);\n\n if (isPromise(result)) {\n return Promise.resolve(result).finally(handleAllureEvent);\n }\n } catch (error) {\n handleAllureEvent();\n throw error;\n }\n\n handleAllureEvent();\n }) as JestEventHandler;\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 = relative(projectConfig.rootDir, context.testPath);\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 if (executableUuid) {\n this.runtime.applyRuntimeMessages(executableUuid, [message]);\n } else {\n this.runtime.applyGlobalRuntimeMessages([message]);\n }\n }\n\n #handleTestEvent(event: Circus.Event, _state: Circus.State) {\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.#handleTestScopeStart();\n break;\n case \"test_fn_start\":\n this.#handleTestStart(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_done\":\n this.#handleTestScopeStop(event.test);\n break;\n case \"test_skip\":\n this.#handleTestSkip(event.test);\n break;\n case \"test_todo\":\n this.#handleTestTodo(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, testTitle: string = test.name) {\n const newTestSuitePath = getTestPath(test.parent);\n const newTestPath = newTestSuitePath.concat(testTitle);\n const newTestId = getTestId(newTestPath);\n\n const projectName = getProjectName();\n const fullNamePath = getPosixPath(this.testPath);\n const fullNameBase = projectName ? `${projectName}:${fullNamePath}` : fullNamePath;\n return `${fullNameBase}#${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 const statusDetails = typeof error === \"string\" ? { message: error } : getMessageAndTraceFromError(error);\n\n this.runtime.updateFixture(fixtureUuid, (r) => {\n r.status = status;\n r.statusDetails = statusDetails;\n r.stage = Stage.FINISHED;\n });\n this.runtime.applyGlobalRuntimeMessages([\n toGlobalErrorMessage({ name: hook.type, details: statusDetails, status }),\n ]);\n this.runtime.stopFixture(fixtureUuid);\n }\n\n #handleTestStart(test: Circus.TestEntry) {\n const fsPath = this.testPath.split(sep);\n const newTestSuitePath = getTestPath(test.parent);\n const projectName = getProjectName();\n const baseTitlePath = fsPath.concat(newTestSuitePath);\n const titlePath = projectName ? [projectName, ...baseTitlePath] : baseTitlePath;\n const { cleanTitle, labels, links } = extractMetadataFromString(test.name);\n const legacyTestId = getTestId(newTestSuitePath.concat(cleanTitle));\n const legacyFullName = `${getPosixPath(this.testPath)}#${legacyTestId}`;\n const newTestFullName = this.#getTestFullName(test, cleanTitle);\n\n if (this.testPlan && !includedInTestPlan(this.testPlan, { fullName: newTestFullName, tags: [test.name] })) {\n test.mode = \"skip\";\n this.runContext.skippedTestsFullNamesByTestPlan.push(newTestFullName);\n return;\n }\n\n const testUuid = this.runtime.startTest(\n {\n name: cleanTitle,\n fullName: newTestFullName,\n start: test.startedAt ?? undefined,\n stage: Stage.RUNNING,\n labels: [\n getLanguageLabel(),\n getFrameworkLabel(\"jest\"),\n getPackageLabel(this.testPath),\n getFallbackTestCaseIdLabel(md5(legacyFullName)),\n getHostLabel(),\n getThreadLabel(env.JEST_WORKER_ID),\n ...getEnvironmentLabels(),\n ...getSuiteLabels(newTestSuitePath),\n ...labels,\n ],\n titlePath,\n links,\n },\n this.runContext.scopes,\n );\n\n this.runContext.executables.push(testUuid);\n\n return testUuid;\n }\n\n #handleTestScopeStart() {\n this.#startScope();\n }\n\n #handleTestScopeStop(test: Circus.TestEntry) {\n const testUuid = this.runContext.executables.pop();\n\n if (testUuid) {\n const { status, details } = this.#statusAndDetails(test.errors);\n let tr: TestResult | undefined;\n this.runtime.updateTest(testUuid, (result) => {\n tr = result;\n });\n // hook failure, finish with the status reported by Jest\n if (tr?.status === undefined && tr?.stage === Stage.RUNNING) {\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...details,\n };\n });\n }\n\n this.runtime.writeTest(testUuid);\n }\n\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 if (!scopeUuid) {\n return;\n }\n\n this.runtime.writeScope(scopeUuid);\n }\n\n #handleTestPass(test: Circus.TestEntry) {\n const testUuid = this.#currentExecutable();\n\n if (!testUuid) {\n return;\n }\n // @ts-ignore\n const { suppressedErrors = [] } = this.global.expect.getState();\n const statusAndDetails = this.#statusAndDetails(suppressedErrors as Circus.TestError[]);\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = statusAndDetails.status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusAndDetails.details,\n };\n });\n\n this.runtime.stopTest(testUuid, { duration: test.duration ?? 0 });\n }\n\n #handleTestFail(test: Circus.TestEntry) {\n const testUuid = this.#currentExecutable();\n\n if (!testUuid) {\n return;\n }\n\n const statusAndDetails = this.#statusAndDetails(test.errors);\n const status =\n test.failing && statusAndDetails.status === Status.BROKEN ? Status.FAILED : statusAndDetails.status;\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusAndDetails.details,\n };\n });\n this.runtime.stopTest(testUuid, { duration: 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 // noinspection JSPotentiallyInvalidUsageOfThis\n const testUuid = this.#handleTestStart(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.SKIPPED;\n });\n // noinspection JSPotentiallyInvalidUsageOfThis\n this.#handleTestScopeStop(test);\n }\n\n #handleTestTodo(test: Circus.TestEntry) {\n // noinspection JSPotentiallyInvalidUsageOfThis\n const testUuid = this.#handleTestStart(test);\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.SKIPPED;\n result.statusDetails = {\n message: \"TODO\",\n };\n });\n // noinspection JSPotentiallyInvalidUsageOfThis\n this.#handleTestScopeStop(test);\n }\n\n #handleRunFinish() {\n this.runtime.writeEnvironmentInfo();\n this.runtime.writeCategoriesDefinitions();\n }\n\n #currentExecutable() {\n if (this.runContext.executables.length === 0) {\n return undefined;\n }\n return this.runContext.executables[this.runContext.executables.length - 1];\n }\n\n #statusAndDetails(errors: Circus.TestError[]): { status: Status; details: Partial<StatusDetails> } {\n if (errors.length === 0) {\n return {\n status: Status.PASSED,\n details: {},\n };\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] = errors;\n const hasMultipleErrors = Array.isArray(error);\n const exception: Circus.Exception = hasMultipleErrors ? error[0] : error;\n const firstError = this.#convertToError(exception);\n\n // in case user throws non-Error type, the first exception is the user-thrown object,\n // while the second one is provided by jest and has correct stack trace\n if (hasMultipleErrors && error.length > 1) {\n const secondError = this.#convertToError(error[1]);\n\n if (!firstError.message) {\n firstError.message = secondError.message;\n }\n\n if (!firstError.stack) {\n firstError.stack = secondError.stack;\n }\n }\n\n const details = getMessageAndTraceFromError(firstError);\n const status = getStatusFromError(firstError);\n\n return { status, details };\n }\n\n #convertToError(exception: Circus.Exception):\n | Error\n | {\n message?: string;\n stack?: string;\n } {\n if (!exception) {\n return {};\n }\n\n // user may throw an object as well\n if (typeof exception !== \"object\" || !(\"stack\" in exception)) {\n return {\n message: serialize(exception),\n };\n }\n\n return exception;\n }\n };\n};\n\nexport { createJestEnvironment };\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,gBAAA,GAAAC,uBAAA,CAAAH,OAAA;AAA4C,IAAAI,MAAA,GAAAF,gBAAA;AAE5C,IAAAG,IAAA,GAAAL,OAAA;AAQA,IAAAM,SAAA,GAAAN,OAAA;AAiBA,IAAAO,QAAA,GAAAP,OAAA;AAEA,IAAAQ,sBAAA,GAAAR,OAAA;AAEA,IAAAS,MAAA,GAAAT,OAAA;AAA+E,IAAAU,SAAA;AAAA,SAAAP,wBAAAQ,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,wBAAAQ,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,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H,iBAAiB,IAAI3I,KAAK,CAAC/C,MAAM,GAAG,CAAC,EAAE;MACzC,IAAMgM,WAAW,GAAGzK,iBAAA,CAAAG,YAAA,MAAI,EAACqK,eAAc,CAAC,CAAA5M,IAAA,CAApB,IAAI,EAAiB4D,KAAK,CAAC,CAAC,CAAC,CAAC;MAElD,IAAI,CAAC+I,UAAU,CAACzH,OAAO,EAAE;QACvByH,UAAU,CAACzH,OAAO,GAAG2H,WAAW,CAAC3H,OAAO;MAC1C;MAEA,IAAI,CAACyH,UAAU,CAACG,KAAK,EAAE;QACrBH,UAAU,CAACG,KAAK,GAAGD,WAAW,CAACC,KAAK;MACtC;IACF;IAEA,IAAMjE,OAAO,GAAG,IAAAF,gCAA2B,EAACgE,UAAU,CAAC;IACvD,IAAM1E,MAAM,GAAG,IAAAQ,uBAAkB,EAACkE,UAAU,CAAC;IAE7C,OAAO;MAAE1E,MAAM;MAAEY;IAAQ,CAAC;EAC5B;EAAC,SAAA+D,gBAEeF,SAA2B,EAKrC;IACJ,IAAI,CAACA,SAAS,EAAE;MACd,OAAO,CAAC,CAAC;IACX;;IAEA;IACA,IAAI,OAAOA,SAAS,KAAK,QAAQ,IAAI,EAAE,OAAO,IAAIA,SAAS,CAAC,EAAE;MAC5D,OAAO;QACLxH,OAAO,EAAE,IAAA6H,cAAS,EAACL,SAAS;MAC9B,CAAC;IACH;IAEA,OAAOA,SAAS;EAClB;AAEJ,CAAC;AAACM,OAAA,CAAA3K,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"file":"environmentFactory.js","names":["_nodePath","require","_nodeProcess","_allureJsCommons","_interopRequireWildcard","allure","_sdk","_reporter","_runtime","_AllureJestTestRuntime","_utils","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","length","l","Symbol","iterator","u","next","done","push","value","return","isArray","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","apply","_objectSpread","arguments","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_objectWithoutProperties","_objectWithoutPropertiesLoose","indexOf","propertyIsEnumerable","_classPrivateMethodInitSpec","_checkPrivateRedeclaration","add","_classPrivateFieldInitSpec","_toPropertyKey","configurable","writable","_toPrimitive","toPrimitive","String","Number","_classPrivateFieldGet","s","_assertClassBrand","createJestEnvironment","Base","_testContexts","_Class_brand","WeakSet","config","context","_this$handleTestEvent","executables","steps","scopes","skippedTestsFullNamesByTestPlan","Map","handleTestEvent","bind","event","state","_this$global$expect$g","_this$global$expect","_this$global$expect$g2","_this$global$expect$g3","hookTest","global","expect","getState","currentTestIdentity","currentlyRunningTest","undefined","handleAllureEvent","_handleTestEvent","result","isPromise","Promise","resolve","finally","error","projectConfig","_ref","testEnvironmentOptions","resultsDir","restConfig","runtime","ReporterRuntime","writer","createDefaultWriter","testPath","relative","rootDir","testPlan","parseTestPlan","enableExcludedTests","testRuntime","AllureJestTestRuntime","setGlobalTestRuntime","setup","teardown","handleAllureRuntimeMessage","message","_this$global$expect2","_context$fixtureUuid","_ref2","_last","getIdentity","identity","last","values","executableUuid","fixtureUuid","uuid","runContext","applyRuntimeMessages","applyGlobalRuntimeMessages","_handleHookStart","hook","_handleHookPass","_handleHookFail","_handleSuiteStart","_handleSuiteEnd","_extractMetadataFromS","extractMetadataFromString","cleanTitle","fullName","_getTestFullName","includedInTestPlan","tags","mode","_handleTestScopeStart","_handleTestStart","_handleTestPass","_handleTestFail","_handleTestScopeStop","_handleTestSkip","_handleTestTodo","_handleRunFinish","testTitle","newTestSuitePath","getTestPath","parent","newTestPath","concat","newTestId","getTestId","projectName","getProjectName","fullNamePath","getPosixPath","fullNameBase","_startScope","_stopScope","_context$scopeUuid","shouldHookBeSkipped","type","endsWith","scopeUuid","startFixture","_context$fixtureUuid2","pop","updateFixture","status","Status","PASSED","stage","Stage","FINISHED","stopFixture","_context$fixtureUuid3","BROKEN","getStatusFromError","statusDetails","getMessageAndTraceFromError","toGlobalErrorMessage","details","_test$startedAt","fsPath","split","sep","baseTitlePath","titlePath","_extractMetadataFromS2","labels","links","legacyTestId","legacyFullName","newTestFullName","testUuid","startTest","start","startedAt","RUNNING","getLanguageLabel","getFrameworkLabel","getPackageLabel","getFallbackTestCaseIdLabel","md5","getHostLabel","getThreadLabel","env","JEST_WORKER_ID","getEnvironmentLabels","getSuiteLabels","startScope","_tr","_tr2","_assertClassBrand$cal","_statusAndDetails","errors","tr","updateTest","writeTest","writeScope","delete","_classPrivateFieldGet2","_test$duration","_this$global$expect$g4","_this$global$expect$g5","suppressedErrors","statusAndDetails","stopTest","duration","_classPrivateFieldGet3","_test$duration2","failing","FAILED","_extractMetadataFromS3","includes","SKIPPED","writeEnvironmentInfo","writeCategoriesDefinitions","_errors","hasMultipleErrors","exception","firstError","_convertToError","secondError","stack","serialize","exports"],"sources":["../../src/environmentFactory.ts"],"sourcesContent":["import { relative, sep } from \"node:path\";\nimport { env } from \"node:process\";\n\nimport type { EnvironmentContext, JestEnvironment, JestEnvironmentConfig } from \"@jest/environment\";\nimport type { Circus } from \"@jest/types\";\nimport * as allure from \"allure-js-commons\";\nimport { Stage, Status, type StatusDetails, type TestResult } from \"allure-js-commons\";\nimport { type RuntimeMessage, type TestPlanV1, serialize } from \"allure-js-commons/sdk\";\nimport {\n extractMetadataFromString,\n getMessageAndTraceFromError,\n getStatusFromError,\n isPromise,\n toGlobalErrorMessage,\n} from \"allure-js-commons/sdk\";\nimport {\n ReporterRuntime,\n createDefaultWriter,\n getEnvironmentLabels,\n getFallbackTestCaseIdLabel,\n getFrameworkLabel,\n getHostLabel,\n getLanguageLabel,\n getPackageLabel,\n getPosixPath,\n getProjectName,\n getSuiteLabels,\n getThreadLabel,\n includedInTestPlan,\n md5,\n parseTestPlan,\n} from \"allure-js-commons/sdk/reporter\";\nimport { setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\n\nimport { AllureJestTestRuntime } from \"./AllureJestTestRuntime.js\";\nimport type { AllureJestConfig, AllureJestEnvironment, AllureJestProjectConfig, RunContext } from \"./model.js\";\nimport { getTestId, getTestPath, last, shouldHookBeSkipped } from \"./utils.js\";\n\ntype JestEnvironmentConstructor = new (...args: any[]) => any;\ntype JestEventHandler = NonNullable<JestEnvironment[\"handleTestEvent\"]>;\ntype CallableJestEventHandler = (event: any, state: Circus.State) => void | PromiseLike<void> | undefined;\n\ntype TestContext = {\n scopeUuid: string;\n uuid?: string;\n fixtureUuid?: string;\n};\n\nconst createJestEnvironment = <T extends JestEnvironmentConstructor>(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 #testContexts = new Map<object, TestContext>();\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 handleTestEvent = this.handleTestEvent?.bind(this) as CallableJestEventHandler | undefined;\n\n // Preserve any event handler defined by the base or custom environment.\n this.handleTestEvent = ((event: any, state: Circus.State) => {\n // Capture the hook owner before a custom handler can yield or change\n // Circus's shared cursor. Runtime messages use the same native identity.\n const hookTest =\n event.name === \"hook_start\"\n ? (this.global.expect?.getState().currentTestIdentity?.() ?? state.currentlyRunningTest)\n : undefined;\n const handleAllureEvent = () => this.#handleTestEvent(event as Circus.Event, hookTest);\n\n // Keep Allure's lifecycle in sync even if the custom environment fails,\n // then rethrow the original error so Jest keeps its native behavior.\n try {\n const result = handleTestEvent?.(event, state);\n\n if (isPromise(result)) {\n return Promise.resolve(result).finally(handleAllureEvent);\n }\n } catch (error) {\n handleAllureEvent();\n throw error;\n }\n\n handleAllureEvent();\n }) as JestEventHandler;\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 = relative(projectConfig.rootDir, context.testPath);\n this.testPlan = parseTestPlan({ enableExcludedTests: true });\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 getIdentity: (() => object | undefined) | undefined = this.global.expect?.getState().currentTestIdentity;\n const identity = getIdentity?.();\n const context = getIdentity\n ? identity && this.#testContexts.get(identity)\n : last([...this.#testContexts.values()]);\n const executableUuid =\n getIdentity && identity\n ? (context?.fixtureUuid ?? context?.uuid)\n : (last(this.runContext.executables) ?? context?.fixtureUuid ?? context?.uuid);\n if (executableUuid) {\n this.runtime.applyRuntimeMessages(executableUuid, [message]);\n } else {\n this.runtime.applyGlobalRuntimeMessages([message]);\n }\n }\n\n #handleTestEvent(event: Circus.Event, hookTest?: Circus.TestEntry | null) {\n switch (event.name) {\n case \"hook_start\":\n this.#handleHookStart(event.hook, hookTest);\n break;\n case \"hook_success\":\n this.#handleHookPass(event.hook, event.test);\n break;\n case \"hook_failure\":\n this.#handleHookFail(event.hook, event.error, event.test);\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 if (this.testPlan) {\n const { cleanTitle } = extractMetadataFromString(event.test.name);\n const fullName = this.#getTestFullName(event.test, cleanTitle);\n if (\n !includedInTestPlan(this.testPlan, { fullName, tags: [event.test.name] }, { enableExcludedTests: true })\n ) {\n event.test.mode = \"skip\";\n this.runContext.skippedTestsFullNamesByTestPlan.push(fullName);\n break;\n }\n }\n this.#handleTestScopeStart(event.test);\n break;\n case \"test_fn_start\":\n this.#handleTestStart(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_done\":\n this.#handleTestScopeStop(event.test);\n break;\n case \"test_skip\":\n this.#handleTestSkip(event.test);\n break;\n case \"test_todo\":\n this.#handleTestTodo(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, testTitle: string = test.name) {\n const newTestSuitePath = getTestPath(test.parent);\n const newTestPath = newTestSuitePath.concat(testTitle);\n const newTestId = getTestId(newTestPath);\n\n const projectName = getProjectName();\n const fullNamePath = getPosixPath(this.testPath);\n const fullNameBase = projectName ? `${projectName}:${fullNamePath}` : fullNamePath;\n return `${fullNameBase}#${newTestId}`;\n }\n\n #handleSuiteStart() {\n this.#startScope();\n }\n\n #handleSuiteEnd() {\n this.#stopScope();\n }\n\n #handleHookStart(hook: Circus.Hook, test?: Circus.TestEntry | null) {\n if (shouldHookBeSkipped(hook)) {\n return;\n }\n\n const context = test && hook.type.endsWith(\"Each\") ? this.#testContexts.get(test) : undefined;\n const scopeUuid = context?.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 if (context) {\n context.fixtureUuid = fixtureUuid;\n } else {\n this.runContext.executables.push(fixtureUuid);\n }\n }\n\n #handleHookPass(hook: Circus.Hook, test?: Circus.TestEntry) {\n if (shouldHookBeSkipped(hook)) {\n return;\n }\n\n const context = test ? this.#testContexts.get(test) : undefined;\n const fixtureUuid = context?.fixtureUuid ?? this.runContext.executables.pop()!;\n if (context) {\n delete context.fixtureUuid;\n }\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: Circus.Exception, test?: Circus.TestEntry) {\n if (shouldHookBeSkipped(hook)) {\n return;\n }\n\n const context = test ? this.#testContexts.get(test) : undefined;\n const fixtureUuid = context?.fixtureUuid ?? this.runContext.executables.pop()!;\n if (context) {\n delete context.fixtureUuid;\n }\n const status = typeof error === \"string\" ? Status.BROKEN : getStatusFromError(error as Error);\n const statusDetails = typeof error === \"string\" ? { message: error } : getMessageAndTraceFromError(error);\n\n this.runtime.updateFixture(fixtureUuid, (r) => {\n r.status = status;\n r.statusDetails = statusDetails;\n r.stage = Stage.FINISHED;\n });\n this.runtime.applyGlobalRuntimeMessages([\n toGlobalErrorMessage({ name: hook.type, details: statusDetails, status }),\n ]);\n this.runtime.stopFixture(fixtureUuid);\n }\n\n #handleTestStart(test: Circus.TestEntry) {\n const fsPath = this.testPath.split(sep);\n const newTestSuitePath = getTestPath(test.parent);\n const projectName = getProjectName();\n const baseTitlePath = fsPath.concat(newTestSuitePath);\n const titlePath = projectName ? [projectName, ...baseTitlePath] : baseTitlePath;\n const { cleanTitle, labels, links } = extractMetadataFromString(test.name);\n const legacyTestId = getTestId(newTestSuitePath.concat(cleanTitle));\n const legacyFullName = `${getPosixPath(this.testPath)}#${legacyTestId}`;\n const newTestFullName = this.#getTestFullName(test, cleanTitle);\n\n const context = this.#handleTestScopeStart(test);\n const testUuid = this.runtime.startTest(\n {\n name: cleanTitle,\n fullName: newTestFullName,\n start: test.startedAt ?? undefined,\n stage: Stage.RUNNING,\n labels: [\n getLanguageLabel(),\n getFrameworkLabel(\"jest\"),\n getPackageLabel(this.testPath),\n getFallbackTestCaseIdLabel(md5(legacyFullName)),\n getHostLabel(),\n getThreadLabel(env.JEST_WORKER_ID),\n ...getEnvironmentLabels(),\n ...getSuiteLabels(newTestSuitePath),\n ...labels,\n ],\n titlePath,\n links,\n },\n [...this.runContext.scopes, context.scopeUuid],\n );\n\n context.uuid = testUuid;\n\n return testUuid;\n }\n\n #handleTestScopeStart(test: Circus.TestEntry) {\n let context = this.#testContexts.get(test);\n if (!context) {\n context = { scopeUuid: this.runtime.startScope() };\n this.#testContexts.set(test, context);\n }\n return context;\n }\n\n #handleTestScopeStop(test: Circus.TestEntry) {\n const context = this.#testContexts.get(test);\n const testUuid = context?.uuid;\n\n if (testUuid) {\n const { status, details } = this.#statusAndDetails(test.errors);\n let tr: TestResult | undefined;\n this.runtime.updateTest(testUuid, (result) => {\n tr = result;\n });\n // hook failure, finish with the status reported by Jest\n if (tr?.status === undefined && tr?.stage === Stage.RUNNING) {\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...details,\n };\n });\n }\n\n this.runtime.writeTest(testUuid);\n }\n\n if (context) {\n this.runtime.writeScope(context.scopeUuid);\n this.#testContexts.delete(test);\n }\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 if (!scopeUuid) {\n return;\n }\n\n this.runtime.writeScope(scopeUuid);\n }\n\n #handleTestPass(test: Circus.TestEntry) {\n const testUuid = this.#testContexts.get(test)?.uuid;\n\n if (!testUuid) {\n return;\n }\n // @ts-ignore\n const { suppressedErrors = [] } = this.global.expect.getState();\n const statusAndDetails = this.#statusAndDetails(suppressedErrors as Circus.TestError[]);\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = statusAndDetails.status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusAndDetails.details,\n };\n });\n\n this.runtime.stopTest(testUuid, { duration: test.duration ?? 0 });\n }\n\n #handleTestFail(test: Circus.TestEntry) {\n const testUuid = this.#testContexts.get(test)?.uuid;\n\n if (!testUuid) {\n return;\n }\n\n const statusAndDetails = this.#statusAndDetails(test.errors);\n const status =\n test.failing && statusAndDetails.status === Status.BROKEN ? Status.FAILED : statusAndDetails.status;\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusAndDetails.details,\n };\n });\n this.runtime.stopTest(testUuid, { duration: test.duration ?? 0 });\n }\n\n #handleTestSkip(test: Circus.TestEntry) {\n const { cleanTitle } = extractMetadataFromString(test.name);\n const newTestFullName = this.#getTestFullName(test, cleanTitle);\n\n if (this.runContext.skippedTestsFullNamesByTestPlan.includes(newTestFullName)) {\n this.#handleTestScopeStop(test);\n return;\n }\n\n // noinspection JSPotentiallyInvalidUsageOfThis\n const testUuid = this.#handleTestStart(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.SKIPPED;\n });\n // noinspection JSPotentiallyInvalidUsageOfThis\n this.#handleTestScopeStop(test);\n }\n\n #handleTestTodo(test: Circus.TestEntry) {\n // noinspection JSPotentiallyInvalidUsageOfThis\n const testUuid = this.#handleTestStart(test);\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.SKIPPED;\n result.statusDetails = {\n message: \"TODO\",\n };\n });\n // noinspection JSPotentiallyInvalidUsageOfThis\n this.#handleTestScopeStop(test);\n }\n\n #handleRunFinish() {\n this.runtime.writeEnvironmentInfo();\n this.runtime.writeCategoriesDefinitions();\n }\n\n #statusAndDetails(errors: Circus.TestError[]): { status: Status; details: Partial<StatusDetails> } {\n if (errors.length === 0) {\n return {\n status: Status.PASSED,\n details: {},\n };\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] = errors;\n const hasMultipleErrors = Array.isArray(error);\n const exception: Circus.Exception = hasMultipleErrors ? error[0] : error;\n const firstError = this.#convertToError(exception);\n\n // in case user throws non-Error type, the first exception is the user-thrown object,\n // while the second one is provided by jest and has correct stack trace\n if (hasMultipleErrors && error.length > 1) {\n const secondError = this.#convertToError(error[1]);\n\n if (!firstError.message) {\n firstError.message = secondError.message;\n }\n\n if (!firstError.stack) {\n firstError.stack = secondError.stack;\n }\n }\n\n const details = getMessageAndTraceFromError(firstError);\n const status = getStatusFromError(firstError);\n\n return { status, details };\n }\n\n #convertToError(exception: Circus.Exception):\n | Error\n | {\n message?: string;\n stack?: string;\n } {\n if (!exception) {\n return {};\n }\n\n // user may throw an object as well\n if (typeof exception !== \"object\" || !(\"stack\" in exception)) {\n return {\n message: serialize(exception),\n };\n }\n\n return exception;\n }\n };\n};\n\nexport { createJestEnvironment };\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,gBAAA,GAAAC,uBAAA,CAAAH,OAAA;AAA4C,IAAAI,MAAA,GAAAF,gBAAA;AAE5C,IAAAG,IAAA,GAAAL,OAAA;AAQA,IAAAM,SAAA,GAAAN,OAAA;AAiBA,IAAAO,QAAA,GAAAP,OAAA;AAEA,IAAAQ,sBAAA,GAAAR,OAAA;AAEA,IAAAS,MAAA,GAAAT,OAAA;AAA+E,IAAAU,SAAA;AAAA,SAAAP,wBAAAQ,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,wBAAAQ,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA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AAU,GAAGhM,iBAAA,CAAAI,YAAA,MAAI,EAAC6L,eAAc,CAAC,CAAA5P,IAAA,CAApB,IAAI,EAAiB0P,SAAS,CAAC;;IAElD;IACA;IACA,IAAID,iBAAiB,IAAI1J,KAAK,CAAC5E,MAAM,GAAG,CAAC,EAAE;MACzC,IAAM0O,WAAW,GAAGlM,iBAAA,CAAAI,YAAA,MAAI,EAAC6L,eAAc,CAAC,CAAA5P,IAAA,CAApB,IAAI,EAAiB+F,KAAK,CAAC,CAAC,CAAC,CAAC;MAElD,IAAI,CAAC4J,UAAU,CAACtI,OAAO,EAAE;QACvBsI,UAAU,CAACtI,OAAO,GAAGwI,WAAW,CAACxI,OAAO;MAC1C;MAEA,IAAI,CAACsI,UAAU,CAACG,KAAK,EAAE;QACrBH,UAAU,CAACG,KAAK,GAAGD,WAAW,CAACC,KAAK;MACtC;IACF;IAEA,IAAM/D,OAAO,GAAG,IAAAF,gCAA2B,EAAC8D,UAAU,CAAC;IACvD,IAAMzE,MAAM,GAAG,IAAAS,uBAAkB,EAACgE,UAAU,CAAC;IAE7C,OAAO;MAAEzE,MAAM;MAAEa;IAAQ,CAAC;EAC5B;EAAC,SAAA6D,gBAEeF,SAA2B,EAKrC;IACJ,IAAI,CAACA,SAAS,EAAE;MACd,OAAO,CAAC,CAAC;IACX;;IAEA;IACA,IAAI,OAAOA,SAAS,KAAK,QAAQ,IAAI,EAAE,OAAO,IAAIA,SAAS,CAAC,EAAE;MAC5D,OAAO;QACLrI,OAAO,EAAE,IAAA0I,cAAS,EAACL,SAAS;MAC9B,CAAC;IACH;IAEA,OAAOA,SAAS;EAClB;AAEJ,CAAC;AAACM,OAAA,CAAApM,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -1,13 +1,21 @@
1
1
  var _excluded = ["resultsDir"];
2
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
5
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
6
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
7
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2
8
  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; }
3
9
  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; }
4
10
  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], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
5
11
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
6
12
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
13
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
7
14
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
8
15
  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; }
9
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
17
  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); }
18
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
11
19
  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"); }
12
20
  import { relative, sep } from "node:path";
13
21
  import { env } from "node:process";
@@ -20,14 +28,14 @@ import { setGlobalTestRuntime } from "allure-js-commons/sdk/runtime";
20
28
  import { AllureJestTestRuntime } from "./AllureJestTestRuntime.js";
21
29
  import { getTestId, getTestPath, last, shouldHookBeSkipped } from "./utils.js";
22
30
  var createJestEnvironment = Base => {
23
- var _Class_brand;
31
+ var _testContexts, _Class_brand;
24
32
  // @ts-expect-error (ts(2545)) Incorrect assumption about a mixin class: https://github.com/microsoft/TypeScript/issues/37142
25
- return _Class_brand = /*#__PURE__*/new WeakSet(), class extends Base {
33
+ return _testContexts = /*#__PURE__*/new WeakMap(), _Class_brand = /*#__PURE__*/new WeakSet(), class extends Base {
26
34
  // config is AllureJestConfig in Jest v28 or greater. In older versions
27
35
  // it's AllureJestProjectConfig. See https://github.com/jestjs/jest/pull/12461
28
- constructor(config, context) {
36
+ constructor(config, _context) {
29
37
  var _this$handleTestEvent;
30
- super(config, context);
38
+ super(config, _context);
31
39
  _classPrivateMethodInitSpec(this, _Class_brand);
32
40
  _defineProperty(this, "testPath", void 0);
33
41
  _defineProperty(this, "testPlan", void 0);
@@ -38,11 +46,16 @@ var createJestEnvironment = Base => {
38
46
  scopes: [],
39
47
  skippedTestsFullNamesByTestPlan: []
40
48
  });
49
+ _classPrivateFieldInitSpec(this, _testContexts, new Map());
41
50
  var handleTestEvent = (_this$handleTestEvent = this.handleTestEvent) === null || _this$handleTestEvent === void 0 ? void 0 : _this$handleTestEvent.bind(this);
42
51
 
43
52
  // Preserve any event handler defined by the base or custom environment.
44
53
  this.handleTestEvent = (event, state) => {
45
- var handleAllureEvent = () => _assertClassBrand(_Class_brand, this, _handleTestEvent).call(this, event, state);
54
+ var _this$global$expect$g, _this$global$expect, _this$global$expect$g2, _this$global$expect$g3;
55
+ // Capture the hook owner before a custom handler can yield or change
56
+ // Circus's shared cursor. Runtime messages use the same native identity.
57
+ var hookTest = event.name === "hook_start" ? (_this$global$expect$g = (_this$global$expect = this.global.expect) === null || _this$global$expect === void 0 || (_this$global$expect$g2 = (_this$global$expect$g3 = _this$global$expect.getState()).currentTestIdentity) === null || _this$global$expect$g2 === void 0 ? void 0 : _this$global$expect$g2.call(_this$global$expect$g3)) !== null && _this$global$expect$g !== void 0 ? _this$global$expect$g : state.currentlyRunningTest : undefined;
58
+ var handleAllureEvent = () => _assertClassBrand(_Class_brand, this, _handleTestEvent).call(this, event, hookTest);
46
59
 
47
60
  // Keep Allure's lifecycle in sync even if the custom environment fails,
48
61
  // then rethrow the original error so Jest keeps its native behavior.
@@ -59,17 +72,17 @@ var createJestEnvironment = Base => {
59
72
  };
60
73
  var projectConfig = "projectConfig" in config ? config.projectConfig : config;
61
74
  var _ref = (projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.testEnvironmentOptions) || {},
62
- {
63
- resultsDir
64
- } = _ref,
75
+ resultsDir = _ref.resultsDir,
65
76
  restConfig = _objectWithoutProperties(_ref, _excluded);
66
77
  this.runtime = new ReporterRuntime(_objectSpread(_objectSpread({}, restConfig), {}, {
67
78
  writer: createDefaultWriter({
68
79
  resultsDir
69
80
  })
70
81
  }));
71
- this.testPath = relative(projectConfig.rootDir, context.testPath);
72
- this.testPlan = parseTestPlan();
82
+ this.testPath = relative(projectConfig.rootDir, _context.testPath);
83
+ this.testPlan = parseTestPlan({
84
+ enableExcludedTests: true
85
+ });
73
86
 
74
87
  // @ts-ignore
75
88
  var testRuntime = new AllureJestTestRuntime(this, this.global);
@@ -85,7 +98,11 @@ var createJestEnvironment = Base => {
85
98
  return super.teardown();
86
99
  }
87
100
  handleAllureRuntimeMessage(message) {
88
- var executableUuid = last(this.runContext.executables);
101
+ var _this$global$expect2, _context$fixtureUuid, _ref2, _last;
102
+ var getIdentity = (_this$global$expect2 = this.global.expect) === null || _this$global$expect2 === void 0 ? void 0 : _this$global$expect2.getState().currentTestIdentity;
103
+ var identity = getIdentity === null || getIdentity === void 0 ? void 0 : getIdentity();
104
+ var context = getIdentity ? identity && _classPrivateFieldGet(_testContexts, this).get(identity) : last([..._classPrivateFieldGet(_testContexts, this).values()]);
105
+ var executableUuid = getIdentity && identity ? (_context$fixtureUuid = context === null || context === void 0 ? void 0 : context.fixtureUuid) !== null && _context$fixtureUuid !== void 0 ? _context$fixtureUuid : context === null || context === void 0 ? void 0 : context.uuid : (_ref2 = (_last = last(this.runContext.executables)) !== null && _last !== void 0 ? _last : context === null || context === void 0 ? void 0 : context.fixtureUuid) !== null && _ref2 !== void 0 ? _ref2 : context === null || context === void 0 ? void 0 : context.uuid;
89
106
  if (executableUuid) {
90
107
  this.runtime.applyRuntimeMessages(executableUuid, [message]);
91
108
  } else {
@@ -93,16 +110,16 @@ var createJestEnvironment = Base => {
93
110
  }
94
111
  }
95
112
  };
96
- function _handleTestEvent(event, _state) {
113
+ function _handleTestEvent(event, hookTest) {
97
114
  switch (event.name) {
98
115
  case "hook_start":
99
- _assertClassBrand(_Class_brand, this, _handleHookStart).call(this, event.hook);
116
+ _assertClassBrand(_Class_brand, this, _handleHookStart).call(this, event.hook, hookTest);
100
117
  break;
101
118
  case "hook_success":
102
- _assertClassBrand(_Class_brand, this, _handleHookPass).call(this, event.hook);
119
+ _assertClassBrand(_Class_brand, this, _handleHookPass).call(this, event.hook, event.test);
103
120
  break;
104
121
  case "hook_failure":
105
- _assertClassBrand(_Class_brand, this, _handleHookFail).call(this, event.hook, event.error);
122
+ _assertClassBrand(_Class_brand, this, _handleHookFail).call(this, event.hook, event.error, event.test);
106
123
  break;
107
124
  case "run_describe_start":
108
125
  _assertClassBrand(_Class_brand, this, _handleSuiteStart).call(this);
@@ -111,7 +128,22 @@ var createJestEnvironment = Base => {
111
128
  _assertClassBrand(_Class_brand, this, _handleSuiteEnd).call(this);
112
129
  break;
113
130
  case "test_start":
114
- _assertClassBrand(_Class_brand, this, _handleTestScopeStart).call(this);
131
+ if (this.testPlan) {
132
+ var _extractMetadataFromS = extractMetadataFromString(event.test.name),
133
+ cleanTitle = _extractMetadataFromS.cleanTitle;
134
+ var fullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, event.test, cleanTitle);
135
+ if (!includedInTestPlan(this.testPlan, {
136
+ fullName,
137
+ tags: [event.test.name]
138
+ }, {
139
+ enableExcludedTests: true
140
+ })) {
141
+ event.test.mode = "skip";
142
+ this.runContext.skippedTestsFullNamesByTestPlan.push(fullName);
143
+ break;
144
+ }
145
+ }
146
+ _assertClassBrand(_Class_brand, this, _handleTestScopeStart).call(this, event.test);
115
147
  break;
116
148
  case "test_fn_start":
117
149
  _assertClassBrand(_Class_brand, this, _handleTestStart).call(this, event.test);
@@ -154,32 +186,48 @@ var createJestEnvironment = Base => {
154
186
  function _handleSuiteEnd() {
155
187
  _assertClassBrand(_Class_brand, this, _stopScope).call(this);
156
188
  }
157
- function _handleHookStart(hook) {
189
+ function _handleHookStart(hook, test) {
190
+ var _context$scopeUuid;
158
191
  if (shouldHookBeSkipped(hook)) {
159
192
  return;
160
193
  }
161
- var scopeUuid = last(this.runContext.scopes);
194
+ var context = test && hook.type.endsWith("Each") ? _classPrivateFieldGet(_testContexts, this).get(test) : undefined;
195
+ var scopeUuid = (_context$scopeUuid = context === null || context === void 0 ? void 0 : context.scopeUuid) !== null && _context$scopeUuid !== void 0 ? _context$scopeUuid : last(this.runContext.scopes);
162
196
  var fixtureUuid = this.runtime.startFixture(scopeUuid, /after/i.test(hook.type) ? "after" : "before", {
163
197
  name: hook.type
164
198
  });
165
- this.runContext.executables.push(fixtureUuid);
199
+ if (context) {
200
+ context.fixtureUuid = fixtureUuid;
201
+ } else {
202
+ this.runContext.executables.push(fixtureUuid);
203
+ }
166
204
  }
167
- function _handleHookPass(hook) {
205
+ function _handleHookPass(hook, test) {
206
+ var _context$fixtureUuid2;
168
207
  if (shouldHookBeSkipped(hook)) {
169
208
  return;
170
209
  }
171
- var fixtureUuid = this.runContext.executables.pop();
210
+ var context = test ? _classPrivateFieldGet(_testContexts, this).get(test) : undefined;
211
+ var fixtureUuid = (_context$fixtureUuid2 = context === null || context === void 0 ? void 0 : context.fixtureUuid) !== null && _context$fixtureUuid2 !== void 0 ? _context$fixtureUuid2 : this.runContext.executables.pop();
212
+ if (context) {
213
+ delete context.fixtureUuid;
214
+ }
172
215
  this.runtime.updateFixture(fixtureUuid, r => {
173
216
  r.status = Status.PASSED;
174
217
  r.stage = Stage.FINISHED;
175
218
  });
176
219
  this.runtime.stopFixture(fixtureUuid);
177
220
  }
178
- function _handleHookFail(hook, error) {
221
+ function _handleHookFail(hook, error, test) {
222
+ var _context$fixtureUuid3;
179
223
  if (shouldHookBeSkipped(hook)) {
180
224
  return;
181
225
  }
182
- var fixtureUuid = this.runContext.executables.pop();
226
+ var context = test ? _classPrivateFieldGet(_testContexts, this).get(test) : undefined;
227
+ var fixtureUuid = (_context$fixtureUuid3 = context === null || context === void 0 ? void 0 : context.fixtureUuid) !== null && _context$fixtureUuid3 !== void 0 ? _context$fixtureUuid3 : this.runContext.executables.pop();
228
+ if (context) {
229
+ delete context.fixtureUuid;
230
+ }
183
231
  var status = typeof error === "string" ? Status.BROKEN : getStatusFromError(error);
184
232
  var statusDetails = typeof error === "string" ? {
185
233
  message: error
@@ -203,22 +251,14 @@ var createJestEnvironment = Base => {
203
251
  var projectName = getProjectName();
204
252
  var baseTitlePath = fsPath.concat(newTestSuitePath);
205
253
  var titlePath = projectName ? [projectName, ...baseTitlePath] : baseTitlePath;
206
- var {
207
- cleanTitle,
208
- labels,
209
- links
210
- } = extractMetadataFromString(test.name);
254
+ var _extractMetadataFromS2 = extractMetadataFromString(test.name),
255
+ cleanTitle = _extractMetadataFromS2.cleanTitle,
256
+ labels = _extractMetadataFromS2.labels,
257
+ links = _extractMetadataFromS2.links;
211
258
  var legacyTestId = getTestId(newTestSuitePath.concat(cleanTitle));
212
259
  var legacyFullName = "".concat(getPosixPath(this.testPath), "#").concat(legacyTestId);
213
260
  var newTestFullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, test, cleanTitle);
214
- if (this.testPlan && !includedInTestPlan(this.testPlan, {
215
- fullName: newTestFullName,
216
- tags: [test.name]
217
- })) {
218
- test.mode = "skip";
219
- this.runContext.skippedTestsFullNamesByTestPlan.push(newTestFullName);
220
- return;
221
- }
261
+ var context = _assertClassBrand(_Class_brand, this, _handleTestScopeStart).call(this, test);
222
262
  var testUuid = this.runtime.startTest({
223
263
  name: cleanTitle,
224
264
  fullName: newTestFullName,
@@ -227,21 +267,28 @@ var createJestEnvironment = Base => {
227
267
  labels: [getLanguageLabel(), getFrameworkLabel("jest"), getPackageLabel(this.testPath), getFallbackTestCaseIdLabel(md5(legacyFullName)), getHostLabel(), getThreadLabel(env.JEST_WORKER_ID), ...getEnvironmentLabels(), ...getSuiteLabels(newTestSuitePath), ...labels],
228
268
  titlePath,
229
269
  links
230
- }, this.runContext.scopes);
231
- this.runContext.executables.push(testUuid);
270
+ }, [...this.runContext.scopes, context.scopeUuid]);
271
+ context.uuid = testUuid;
232
272
  return testUuid;
233
273
  }
234
- function _handleTestScopeStart() {
235
- _assertClassBrand(_Class_brand, this, _startScope).call(this);
274
+ function _handleTestScopeStart(test) {
275
+ var context = _classPrivateFieldGet(_testContexts, this).get(test);
276
+ if (!context) {
277
+ context = {
278
+ scopeUuid: this.runtime.startScope()
279
+ };
280
+ _classPrivateFieldGet(_testContexts, this).set(test, context);
281
+ }
282
+ return context;
236
283
  }
237
284
  function _handleTestScopeStop(test) {
238
- var testUuid = this.runContext.executables.pop();
285
+ var context = _classPrivateFieldGet(_testContexts, this).get(test);
286
+ var testUuid = context === null || context === void 0 ? void 0 : context.uuid;
239
287
  if (testUuid) {
240
288
  var _tr, _tr2;
241
- var {
242
- status,
243
- details
244
- } = _assertClassBrand(_Class_brand, this, _statusAndDetails).call(this, test.errors);
289
+ var _assertClassBrand$cal = _assertClassBrand(_Class_brand, this, _statusAndDetails).call(this, test.errors),
290
+ status = _assertClassBrand$cal.status,
291
+ details = _assertClassBrand$cal.details;
245
292
  var tr;
246
293
  this.runtime.updateTest(testUuid, result => {
247
294
  tr = result;
@@ -256,7 +303,10 @@ var createJestEnvironment = Base => {
256
303
  }
257
304
  this.runtime.writeTest(testUuid);
258
305
  }
259
- _assertClassBrand(_Class_brand, this, _stopScope).call(this);
306
+ if (context) {
307
+ this.runtime.writeScope(context.scopeUuid);
308
+ _classPrivateFieldGet(_testContexts, this).delete(test);
309
+ }
260
310
  }
261
311
  function _startScope() {
262
312
  var scopeUuid = this.runtime.startScope();
@@ -270,15 +320,15 @@ var createJestEnvironment = Base => {
270
320
  this.runtime.writeScope(scopeUuid);
271
321
  }
272
322
  function _handleTestPass(test) {
273
- var _test$duration;
274
- var testUuid = _assertClassBrand(_Class_brand, this, _currentExecutable).call(this);
323
+ var _classPrivateFieldGet2, _test$duration;
324
+ var testUuid = (_classPrivateFieldGet2 = _classPrivateFieldGet(_testContexts, this).get(test)) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.uuid;
275
325
  if (!testUuid) {
276
326
  return;
277
327
  }
278
328
  // @ts-ignore
279
- var {
280
- suppressedErrors = []
281
- } = this.global.expect.getState();
329
+ var _this$global$expect$g4 = this.global.expect.getState(),
330
+ _this$global$expect$g5 = _this$global$expect$g4.suppressedErrors,
331
+ suppressedErrors = _this$global$expect$g5 === void 0 ? [] : _this$global$expect$g5;
282
332
  var statusAndDetails = _assertClassBrand(_Class_brand, this, _statusAndDetails).call(this, suppressedErrors);
283
333
  this.runtime.updateTest(testUuid, result => {
284
334
  result.stage = Stage.FINISHED;
@@ -290,8 +340,8 @@ var createJestEnvironment = Base => {
290
340
  });
291
341
  }
292
342
  function _handleTestFail(test) {
293
- var _test$duration2;
294
- var testUuid = _assertClassBrand(_Class_brand, this, _currentExecutable).call(this);
343
+ var _classPrivateFieldGet3, _test$duration2;
344
+ var testUuid = (_classPrivateFieldGet3 = _classPrivateFieldGet(_testContexts, this).get(test)) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.uuid;
295
345
  if (!testUuid) {
296
346
  return;
297
347
  }
@@ -307,8 +357,11 @@ var createJestEnvironment = Base => {
307
357
  });
308
358
  }
309
359
  function _handleTestSkip(test) {
310
- var newTestFullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, test);
360
+ var _extractMetadataFromS3 = extractMetadataFromString(test.name),
361
+ cleanTitle = _extractMetadataFromS3.cleanTitle;
362
+ var newTestFullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, test, cleanTitle);
311
363
  if (this.runContext.skippedTestsFullNamesByTestPlan.includes(newTestFullName)) {
364
+ _assertClassBrand(_Class_brand, this, _handleTestScopeStop).call(this, test);
312
365
  return;
313
366
  }
314
367
 
@@ -344,12 +397,6 @@ var createJestEnvironment = Base => {
344
397
  this.runtime.writeEnvironmentInfo();
345
398
  this.runtime.writeCategoriesDefinitions();
346
399
  }
347
- function _currentExecutable() {
348
- if (this.runContext.executables.length === 0) {
349
- return undefined;
350
- }
351
- return this.runContext.executables[this.runContext.executables.length - 1];
352
- }
353
400
  function _statusAndDetails(errors) {
354
401
  if (errors.length === 0) {
355
402
  return {
@@ -359,7 +406,8 @@ var createJestEnvironment = Base => {
359
406
  }
360
407
 
361
408
  // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed
362
- var [error] = errors;
409
+ var _errors = _slicedToArray(errors, 1),
410
+ error = _errors[0];
363
411
  var hasMultipleErrors = Array.isArray(error);
364
412
  var exception = hasMultipleErrors ? error[0] : error;
365
413
  var firstError = _assertClassBrand(_Class_brand, this, _convertToError).call(this, exception);
@@ -1 +1 @@
1
- {"version":3,"file":"environmentFactory.js","names":["relative","sep","env","allure","Stage","Status","serialize","extractMetadataFromString","getMessageAndTraceFromError","getStatusFromError","isPromise","toGlobalErrorMessage","ReporterRuntime","createDefaultWriter","getEnvironmentLabels","getFallbackTestCaseIdLabel","getFrameworkLabel","getHostLabel","getLanguageLabel","getPackageLabel","getPosixPath","getProjectName","getSuiteLabels","getThreadLabel","includedInTestPlan","md5","parseTestPlan","setGlobalTestRuntime","AllureJestTestRuntime","getTestId","getTestPath","last","shouldHookBeSkipped","createJestEnvironment","Base","_Class_brand","WeakSet","constructor","config","context","_this$handleTestEvent","_classPrivateMethodInitSpec","_defineProperty","executables","steps","scopes","skippedTestsFullNamesByTestPlan","handleTestEvent","bind","event","state","handleAllureEvent","_assertClassBrand","_handleTestEvent","call","result","Promise","resolve","finally","error","projectConfig","_ref","testEnvironmentOptions","resultsDir","restConfig","_objectWithoutProperties","_excluded","runtime","_objectSpread","writer","testPath","rootDir","testPlan","testRuntime","global","setup","teardown","handleAllureRuntimeMessage","message","executableUuid","runContext","applyRuntimeMessages","applyGlobalRuntimeMessages","_state","name","_handleHookStart","hook","_handleHookPass","_handleHookFail","_handleSuiteStart","_handleSuiteEnd","_handleTestScopeStart","_handleTestStart","test","_handleTestPass","_handleTestFail","_handleTestScopeStop","_handleTestSkip","_handleTestTodo","_handleRunFinish","_getTestFullName","testTitle","arguments","length","undefined","newTestSuitePath","parent","newTestPath","concat","newTestId","projectName","fullNamePath","fullNameBase","_startScope","_stopScope","scopeUuid","fixtureUuid","startFixture","type","push","pop","updateFixture","r","status","PASSED","stage","FINISHED","stopFixture","BROKEN","statusDetails","details","_test$startedAt","fsPath","split","baseTitlePath","titlePath","cleanTitle","labels","links","legacyTestId","legacyFullName","newTestFullName","fullName","tags","mode","testUuid","startTest","start","startedAt","RUNNING","JEST_WORKER_ID","_tr","_tr2","_statusAndDetails","errors","tr","updateTest","writeTest","startScope","writeScope","_test$duration","_currentExecutable","suppressedErrors","expect","getState","statusAndDetails","stopTest","duration","_test$duration2","failing","FAILED","includes","SKIPPED","writeEnvironmentInfo","writeCategoriesDefinitions","hasMultipleErrors","Array","isArray","exception","firstError","_convertToError","secondError","stack"],"sources":["../../src/environmentFactory.ts"],"sourcesContent":["import { relative, sep } from \"node:path\";\nimport { env } from \"node:process\";\n\nimport type { EnvironmentContext, JestEnvironment, JestEnvironmentConfig } from \"@jest/environment\";\nimport type { Circus } from \"@jest/types\";\nimport * as allure from \"allure-js-commons\";\nimport { Stage, Status, type StatusDetails, type TestResult } from \"allure-js-commons\";\nimport { type RuntimeMessage, type TestPlanV1, serialize } from \"allure-js-commons/sdk\";\nimport {\n extractMetadataFromString,\n getMessageAndTraceFromError,\n getStatusFromError,\n isPromise,\n toGlobalErrorMessage,\n} from \"allure-js-commons/sdk\";\nimport {\n ReporterRuntime,\n createDefaultWriter,\n getEnvironmentLabels,\n getFallbackTestCaseIdLabel,\n getFrameworkLabel,\n getHostLabel,\n getLanguageLabel,\n getPackageLabel,\n getPosixPath,\n getProjectName,\n getSuiteLabels,\n getThreadLabel,\n includedInTestPlan,\n md5,\n parseTestPlan,\n} from \"allure-js-commons/sdk/reporter\";\nimport { setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\n\nimport { AllureJestTestRuntime } from \"./AllureJestTestRuntime.js\";\nimport type { AllureJestConfig, AllureJestEnvironment, AllureJestProjectConfig, RunContext } from \"./model.js\";\nimport { getTestId, getTestPath, last, shouldHookBeSkipped } from \"./utils.js\";\n\ntype JestEnvironmentConstructor = new (...args: any[]) => any;\ntype JestEventHandler = NonNullable<JestEnvironment[\"handleTestEvent\"]>;\ntype CallableJestEventHandler = (event: any, state: Circus.State) => void | PromiseLike<void> | undefined;\n\nconst createJestEnvironment = <T extends JestEnvironmentConstructor>(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 handleTestEvent = this.handleTestEvent?.bind(this) as CallableJestEventHandler | undefined;\n\n // Preserve any event handler defined by the base or custom environment.\n this.handleTestEvent = ((event: any, state: Circus.State) => {\n const handleAllureEvent = () => this.#handleTestEvent(event as Circus.Event, state as Circus.State);\n\n // Keep Allure's lifecycle in sync even if the custom environment fails,\n // then rethrow the original error so Jest keeps its native behavior.\n try {\n const result = handleTestEvent?.(event, state);\n\n if (isPromise(result)) {\n return Promise.resolve(result).finally(handleAllureEvent);\n }\n } catch (error) {\n handleAllureEvent();\n throw error;\n }\n\n handleAllureEvent();\n }) as JestEventHandler;\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 = relative(projectConfig.rootDir, context.testPath);\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 if (executableUuid) {\n this.runtime.applyRuntimeMessages(executableUuid, [message]);\n } else {\n this.runtime.applyGlobalRuntimeMessages([message]);\n }\n }\n\n #handleTestEvent(event: Circus.Event, _state: Circus.State) {\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.#handleTestScopeStart();\n break;\n case \"test_fn_start\":\n this.#handleTestStart(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_done\":\n this.#handleTestScopeStop(event.test);\n break;\n case \"test_skip\":\n this.#handleTestSkip(event.test);\n break;\n case \"test_todo\":\n this.#handleTestTodo(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, testTitle: string = test.name) {\n const newTestSuitePath = getTestPath(test.parent);\n const newTestPath = newTestSuitePath.concat(testTitle);\n const newTestId = getTestId(newTestPath);\n\n const projectName = getProjectName();\n const fullNamePath = getPosixPath(this.testPath);\n const fullNameBase = projectName ? `${projectName}:${fullNamePath}` : fullNamePath;\n return `${fullNameBase}#${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 const statusDetails = typeof error === \"string\" ? { message: error } : getMessageAndTraceFromError(error);\n\n this.runtime.updateFixture(fixtureUuid, (r) => {\n r.status = status;\n r.statusDetails = statusDetails;\n r.stage = Stage.FINISHED;\n });\n this.runtime.applyGlobalRuntimeMessages([\n toGlobalErrorMessage({ name: hook.type, details: statusDetails, status }),\n ]);\n this.runtime.stopFixture(fixtureUuid);\n }\n\n #handleTestStart(test: Circus.TestEntry) {\n const fsPath = this.testPath.split(sep);\n const newTestSuitePath = getTestPath(test.parent);\n const projectName = getProjectName();\n const baseTitlePath = fsPath.concat(newTestSuitePath);\n const titlePath = projectName ? [projectName, ...baseTitlePath] : baseTitlePath;\n const { cleanTitle, labels, links } = extractMetadataFromString(test.name);\n const legacyTestId = getTestId(newTestSuitePath.concat(cleanTitle));\n const legacyFullName = `${getPosixPath(this.testPath)}#${legacyTestId}`;\n const newTestFullName = this.#getTestFullName(test, cleanTitle);\n\n if (this.testPlan && !includedInTestPlan(this.testPlan, { fullName: newTestFullName, tags: [test.name] })) {\n test.mode = \"skip\";\n this.runContext.skippedTestsFullNamesByTestPlan.push(newTestFullName);\n return;\n }\n\n const testUuid = this.runtime.startTest(\n {\n name: cleanTitle,\n fullName: newTestFullName,\n start: test.startedAt ?? undefined,\n stage: Stage.RUNNING,\n labels: [\n getLanguageLabel(),\n getFrameworkLabel(\"jest\"),\n getPackageLabel(this.testPath),\n getFallbackTestCaseIdLabel(md5(legacyFullName)),\n getHostLabel(),\n getThreadLabel(env.JEST_WORKER_ID),\n ...getEnvironmentLabels(),\n ...getSuiteLabels(newTestSuitePath),\n ...labels,\n ],\n titlePath,\n links,\n },\n this.runContext.scopes,\n );\n\n this.runContext.executables.push(testUuid);\n\n return testUuid;\n }\n\n #handleTestScopeStart() {\n this.#startScope();\n }\n\n #handleTestScopeStop(test: Circus.TestEntry) {\n const testUuid = this.runContext.executables.pop();\n\n if (testUuid) {\n const { status, details } = this.#statusAndDetails(test.errors);\n let tr: TestResult | undefined;\n this.runtime.updateTest(testUuid, (result) => {\n tr = result;\n });\n // hook failure, finish with the status reported by Jest\n if (tr?.status === undefined && tr?.stage === Stage.RUNNING) {\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...details,\n };\n });\n }\n\n this.runtime.writeTest(testUuid);\n }\n\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 if (!scopeUuid) {\n return;\n }\n\n this.runtime.writeScope(scopeUuid);\n }\n\n #handleTestPass(test: Circus.TestEntry) {\n const testUuid = this.#currentExecutable();\n\n if (!testUuid) {\n return;\n }\n // @ts-ignore\n const { suppressedErrors = [] } = this.global.expect.getState();\n const statusAndDetails = this.#statusAndDetails(suppressedErrors as Circus.TestError[]);\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = statusAndDetails.status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusAndDetails.details,\n };\n });\n\n this.runtime.stopTest(testUuid, { duration: test.duration ?? 0 });\n }\n\n #handleTestFail(test: Circus.TestEntry) {\n const testUuid = this.#currentExecutable();\n\n if (!testUuid) {\n return;\n }\n\n const statusAndDetails = this.#statusAndDetails(test.errors);\n const status =\n test.failing && statusAndDetails.status === Status.BROKEN ? Status.FAILED : statusAndDetails.status;\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusAndDetails.details,\n };\n });\n this.runtime.stopTest(testUuid, { duration: 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 // noinspection JSPotentiallyInvalidUsageOfThis\n const testUuid = this.#handleTestStart(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.SKIPPED;\n });\n // noinspection JSPotentiallyInvalidUsageOfThis\n this.#handleTestScopeStop(test);\n }\n\n #handleTestTodo(test: Circus.TestEntry) {\n // noinspection JSPotentiallyInvalidUsageOfThis\n const testUuid = this.#handleTestStart(test);\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.SKIPPED;\n result.statusDetails = {\n message: \"TODO\",\n };\n });\n // noinspection JSPotentiallyInvalidUsageOfThis\n this.#handleTestScopeStop(test);\n }\n\n #handleRunFinish() {\n this.runtime.writeEnvironmentInfo();\n this.runtime.writeCategoriesDefinitions();\n }\n\n #currentExecutable() {\n if (this.runContext.executables.length === 0) {\n return undefined;\n }\n return this.runContext.executables[this.runContext.executables.length - 1];\n }\n\n #statusAndDetails(errors: Circus.TestError[]): { status: Status; details: Partial<StatusDetails> } {\n if (errors.length === 0) {\n return {\n status: Status.PASSED,\n details: {},\n };\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] = errors;\n const hasMultipleErrors = Array.isArray(error);\n const exception: Circus.Exception = hasMultipleErrors ? error[0] : error;\n const firstError = this.#convertToError(exception);\n\n // in case user throws non-Error type, the first exception is the user-thrown object,\n // while the second one is provided by jest and has correct stack trace\n if (hasMultipleErrors && error.length > 1) {\n const secondError = this.#convertToError(error[1]);\n\n if (!firstError.message) {\n firstError.message = secondError.message;\n }\n\n if (!firstError.stack) {\n firstError.stack = secondError.stack;\n }\n }\n\n const details = getMessageAndTraceFromError(firstError);\n const status = getStatusFromError(firstError);\n\n return { status, details };\n }\n\n #convertToError(exception: Circus.Exception):\n | Error\n | {\n message?: string;\n stack?: string;\n } {\n if (!exception) {\n return {};\n }\n\n // user may throw an object as well\n if (typeof exception !== \"object\" || !(\"stack\" in exception)) {\n return {\n message: serialize(exception),\n };\n }\n\n return exception;\n }\n };\n};\n\nexport { createJestEnvironment };\n"],"mappings":";;;;;;;;;;;AAAA,SAASA,QAAQ,EAAEC,GAAG,QAAQ,WAAW;AACzC,SAASC,GAAG,QAAQ,cAAc;AAIlC,OAAO,KAAKC,MAAM,MAAM,mBAAmB;AAC3C,SAASC,KAAK,EAAEC,MAAM,QAA6C,mBAAmB;AACtF,SAA+CC,SAAS,QAAQ,uBAAuB;AACvF,SACEC,yBAAyB,EACzBC,2BAA2B,EAC3BC,kBAAkB,EAClBC,SAAS,EACTC,oBAAoB,QACf,uBAAuB;AAC9B,SACEC,eAAe,EACfC,mBAAmB,EACn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AED,SAASjJ,qBAAqB","ignoreList":[]}
1
+ {"version":3,"file":"environmentFactory.js","names":["relative","sep","env","allure","Stage","Status","serialize","extractMetadataFromString","getMessageAndTraceFromError","getStatusFromError","isPromise","toGlobalErrorMessage","ReporterRuntime","createDefaultWriter","getEnvironmentLabels","getFallbackTestCaseIdLabel","getFrameworkLabel","getHostLabel","getLanguageLabel","getPackageLabel","getPosixPath","getProjectName","getSuiteLabels","getThreadLabel","includedInTestPlan","md5","parseTestPlan","setGlobalTestRuntime","AllureJestTestRuntime","getTestId","getTestPath","last","shouldHookBeSkipped","createJestEnvironment","Base","_testContexts","_Class_brand","WeakMap","WeakSet","constructor","config","context","_this$handleTestEvent","_classPrivateMethodInitSpec","_defineProperty","executables","steps","scopes","skippedTestsFullNamesByTestPlan","_classPrivateFieldInitSpec","Map","handleTestEvent","bind","event","state","_this$global$expect$g","_this$global$expect","_this$global$expect$g2","_this$global$expect$g3","hookTest","name","global","expect","getState","currentTestIdentity","call","currentlyRunningTest","undefined","handleAllureEvent","_assertClassBrand","_handleTestEvent","result","Promise","resolve","finally","error","projectConfig","_ref","testEnvironmentOptions","resultsDir","restConfig","_objectWithoutProperties","_excluded","runtime","_objectSpread","writer","testPath","rootDir","testPlan","enableExcludedTests","testRuntime","setup","teardown","handleAllureRuntimeMessage","message","_this$global$expect2","_context$fixtureUuid","_ref2","_last","getIdentity","identity","_classPrivateFieldGet","get","values","executableUuid","fixtureUuid","uuid","runContext","applyRuntimeMessages","applyGlobalRuntimeMessages","_handleHookStart","hook","_handleHookPass","test","_handleHookFail","_handleSuiteStart","_handleSuiteEnd","_extractMetadataFromS","cleanTitle","fullName","_getTestFullName","tags","mode","push","_handleTestScopeStart","_handleTestStart","_handleTestPass","_handleTestFail","_handleTestScopeStop","_handleTestSkip","_handleTestTodo","_handleRunFinish","testTitle","arguments","length","newTestSuitePath","parent","newTestPath","concat","newTestId","projectName","fullNamePath","fullNameBase","_startScope","_stopScope","_context$scopeUuid","type","endsWith","scopeUuid","startFixture","_context$fixtureUuid2","pop","updateFixture","r","status","PASSED","stage","FINISHED","stopFixture","_context$fixtureUuid3","BROKEN","statusDetails","details","_test$startedAt","fsPath","split","baseTitlePath","titlePath","_extractMetadataFromS2","labels","links","legacyTestId","legacyFullName","newTestFullName","testUuid","startTest","start","startedAt","RUNNING","JEST_WORKER_ID","startScope","set","_tr","_tr2","_assertClassBrand$cal","_statusAndDetails","errors","tr","updateTest","writeTest","writeScope","delete","_classPrivateFieldGet2","_test$duration","_this$global$expect$g4","_this$global$expect$g5","suppressedErrors","statusAndDetails","stopTest","duration","_classPrivateFieldGet3","_test$duration2","failing","FAILED","_extractMetadataFromS3","includes","SKIPPED","writeEnvironmentInfo","writeCategoriesDefinitions","_errors","_slicedToArray","hasMultipleErrors","Array","isArray","exception","firstError","_convertToError","secondError","stack"],"sources":["../../src/environmentFactory.ts"],"sourcesContent":["import { relative, sep } from \"node:path\";\nimport { env } from \"node:process\";\n\nimport type { EnvironmentContext, JestEnvironment, JestEnvironmentConfig } from \"@jest/environment\";\nimport type { Circus } from \"@jest/types\";\nimport * as allure from \"allure-js-commons\";\nimport { Stage, Status, type StatusDetails, type TestResult } from \"allure-js-commons\";\nimport { type RuntimeMessage, type TestPlanV1, serialize } from \"allure-js-commons/sdk\";\nimport {\n extractMetadataFromString,\n getMessageAndTraceFromError,\n getStatusFromError,\n isPromise,\n toGlobalErrorMessage,\n} from \"allure-js-commons/sdk\";\nimport {\n ReporterRuntime,\n createDefaultWriter,\n getEnvironmentLabels,\n getFallbackTestCaseIdLabel,\n getFrameworkLabel,\n getHostLabel,\n getLanguageLabel,\n getPackageLabel,\n getPosixPath,\n getProjectName,\n getSuiteLabels,\n getThreadLabel,\n includedInTestPlan,\n md5,\n parseTestPlan,\n} from \"allure-js-commons/sdk/reporter\";\nimport { setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\n\nimport { AllureJestTestRuntime } from \"./AllureJestTestRuntime.js\";\nimport type { AllureJestConfig, AllureJestEnvironment, AllureJestProjectConfig, RunContext } from \"./model.js\";\nimport { getTestId, getTestPath, last, shouldHookBeSkipped } from \"./utils.js\";\n\ntype JestEnvironmentConstructor = new (...args: any[]) => any;\ntype JestEventHandler = NonNullable<JestEnvironment[\"handleTestEvent\"]>;\ntype CallableJestEventHandler = (event: any, state: Circus.State) => void | PromiseLike<void> | undefined;\n\ntype TestContext = {\n scopeUuid: string;\n uuid?: string;\n fixtureUuid?: string;\n};\n\nconst createJestEnvironment = <T extends JestEnvironmentConstructor>(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 #testContexts = new Map<object, TestContext>();\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 handleTestEvent = this.handleTestEvent?.bind(this) as CallableJestEventHandler | undefined;\n\n // Preserve any event handler defined by the base or custom environment.\n this.handleTestEvent = ((event: any, state: Circus.State) => {\n // Capture the hook owner before a custom handler can yield or change\n // Circus's shared cursor. Runtime messages use the same native identity.\n const hookTest =\n event.name === \"hook_start\"\n ? (this.global.expect?.getState().currentTestIdentity?.() ?? state.currentlyRunningTest)\n : undefined;\n const handleAllureEvent = () => this.#handleTestEvent(event as Circus.Event, hookTest);\n\n // Keep Allure's lifecycle in sync even if the custom environment fails,\n // then rethrow the original error so Jest keeps its native behavior.\n try {\n const result = handleTestEvent?.(event, state);\n\n if (isPromise(result)) {\n return Promise.resolve(result).finally(handleAllureEvent);\n }\n } catch (error) {\n handleAllureEvent();\n throw error;\n }\n\n handleAllureEvent();\n }) as JestEventHandler;\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 = relative(projectConfig.rootDir, context.testPath);\n this.testPlan = parseTestPlan({ enableExcludedTests: true });\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 getIdentity: (() => object | undefined) | undefined = this.global.expect?.getState().currentTestIdentity;\n const identity = getIdentity?.();\n const context = getIdentity\n ? identity && this.#testContexts.get(identity)\n : last([...this.#testContexts.values()]);\n const executableUuid =\n getIdentity && identity\n ? (context?.fixtureUuid ?? context?.uuid)\n : (last(this.runContext.executables) ?? context?.fixtureUuid ?? context?.uuid);\n if (executableUuid) {\n this.runtime.applyRuntimeMessages(executableUuid, [message]);\n } else {\n this.runtime.applyGlobalRuntimeMessages([message]);\n }\n }\n\n #handleTestEvent(event: Circus.Event, hookTest?: Circus.TestEntry | null) {\n switch (event.name) {\n case \"hook_start\":\n this.#handleHookStart(event.hook, hookTest);\n break;\n case \"hook_success\":\n this.#handleHookPass(event.hook, event.test);\n break;\n case \"hook_failure\":\n this.#handleHookFail(event.hook, event.error, event.test);\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 if (this.testPlan) {\n const { cleanTitle } = extractMetadataFromString(event.test.name);\n const fullName = this.#getTestFullName(event.test, cleanTitle);\n if (\n !includedInTestPlan(this.testPlan, { fullName, tags: [event.test.name] }, { enableExcludedTests: true })\n ) {\n event.test.mode = \"skip\";\n this.runContext.skippedTestsFullNamesByTestPlan.push(fullName);\n break;\n }\n }\n this.#handleTestScopeStart(event.test);\n break;\n case \"test_fn_start\":\n this.#handleTestStart(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_done\":\n this.#handleTestScopeStop(event.test);\n break;\n case \"test_skip\":\n this.#handleTestSkip(event.test);\n break;\n case \"test_todo\":\n this.#handleTestTodo(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, testTitle: string = test.name) {\n const newTestSuitePath = getTestPath(test.parent);\n const newTestPath = newTestSuitePath.concat(testTitle);\n const newTestId = getTestId(newTestPath);\n\n const projectName = getProjectName();\n const fullNamePath = getPosixPath(this.testPath);\n const fullNameBase = projectName ? `${projectName}:${fullNamePath}` : fullNamePath;\n return `${fullNameBase}#${newTestId}`;\n }\n\n #handleSuiteStart() {\n this.#startScope();\n }\n\n #handleSuiteEnd() {\n this.#stopScope();\n }\n\n #handleHookStart(hook: Circus.Hook, test?: Circus.TestEntry | null) {\n if (shouldHookBeSkipped(hook)) {\n return;\n }\n\n const context = test && hook.type.endsWith(\"Each\") ? this.#testContexts.get(test) : undefined;\n const scopeUuid = context?.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 if (context) {\n context.fixtureUuid = fixtureUuid;\n } else {\n this.runContext.executables.push(fixtureUuid);\n }\n }\n\n #handleHookPass(hook: Circus.Hook, test?: Circus.TestEntry) {\n if (shouldHookBeSkipped(hook)) {\n return;\n }\n\n const context = test ? this.#testContexts.get(test) : undefined;\n const fixtureUuid = context?.fixtureUuid ?? this.runContext.executables.pop()!;\n if (context) {\n delete context.fixtureUuid;\n }\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: Circus.Exception, test?: Circus.TestEntry) {\n if (shouldHookBeSkipped(hook)) {\n return;\n }\n\n const context = test ? this.#testContexts.get(test) : undefined;\n const fixtureUuid = context?.fixtureUuid ?? this.runContext.executables.pop()!;\n if (context) {\n delete context.fixtureUuid;\n }\n const status = typeof error === \"string\" ? Status.BROKEN : getStatusFromError(error as Error);\n const statusDetails = typeof error === \"string\" ? { message: error } : getMessageAndTraceFromError(error);\n\n this.runtime.updateFixture(fixtureUuid, (r) => {\n r.status = status;\n r.statusDetails = statusDetails;\n r.stage = Stage.FINISHED;\n });\n this.runtime.applyGlobalRuntimeMessages([\n toGlobalErrorMessage({ name: hook.type, details: statusDetails, status }),\n ]);\n this.runtime.stopFixture(fixtureUuid);\n }\n\n #handleTestStart(test: Circus.TestEntry) {\n const fsPath = this.testPath.split(sep);\n const newTestSuitePath = getTestPath(test.parent);\n const projectName = getProjectName();\n const baseTitlePath = fsPath.concat(newTestSuitePath);\n const titlePath = projectName ? [projectName, ...baseTitlePath] : baseTitlePath;\n const { cleanTitle, labels, links } = extractMetadataFromString(test.name);\n const legacyTestId = getTestId(newTestSuitePath.concat(cleanTitle));\n const legacyFullName = `${getPosixPath(this.testPath)}#${legacyTestId}`;\n const newTestFullName = this.#getTestFullName(test, cleanTitle);\n\n const context = this.#handleTestScopeStart(test);\n const testUuid = this.runtime.startTest(\n {\n name: cleanTitle,\n fullName: newTestFullName,\n start: test.startedAt ?? undefined,\n stage: Stage.RUNNING,\n labels: [\n getLanguageLabel(),\n getFrameworkLabel(\"jest\"),\n getPackageLabel(this.testPath),\n getFallbackTestCaseIdLabel(md5(legacyFullName)),\n getHostLabel(),\n getThreadLabel(env.JEST_WORKER_ID),\n ...getEnvironmentLabels(),\n ...getSuiteLabels(newTestSuitePath),\n ...labels,\n ],\n titlePath,\n links,\n },\n [...this.runContext.scopes, context.scopeUuid],\n );\n\n context.uuid = testUuid;\n\n return testUuid;\n }\n\n #handleTestScopeStart(test: Circus.TestEntry) {\n let context = this.#testContexts.get(test);\n if (!context) {\n context = { scopeUuid: this.runtime.startScope() };\n this.#testContexts.set(test, context);\n }\n return context;\n }\n\n #handleTestScopeStop(test: Circus.TestEntry) {\n const context = this.#testContexts.get(test);\n const testUuid = context?.uuid;\n\n if (testUuid) {\n const { status, details } = this.#statusAndDetails(test.errors);\n let tr: TestResult | undefined;\n this.runtime.updateTest(testUuid, (result) => {\n tr = result;\n });\n // hook failure, finish with the status reported by Jest\n if (tr?.status === undefined && tr?.stage === Stage.RUNNING) {\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...details,\n };\n });\n }\n\n this.runtime.writeTest(testUuid);\n }\n\n if (context) {\n this.runtime.writeScope(context.scopeUuid);\n this.#testContexts.delete(test);\n }\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 if (!scopeUuid) {\n return;\n }\n\n this.runtime.writeScope(scopeUuid);\n }\n\n #handleTestPass(test: Circus.TestEntry) {\n const testUuid = this.#testContexts.get(test)?.uuid;\n\n if (!testUuid) {\n return;\n }\n // @ts-ignore\n const { suppressedErrors = [] } = this.global.expect.getState();\n const statusAndDetails = this.#statusAndDetails(suppressedErrors as Circus.TestError[]);\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = statusAndDetails.status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusAndDetails.details,\n };\n });\n\n this.runtime.stopTest(testUuid, { duration: test.duration ?? 0 });\n }\n\n #handleTestFail(test: Circus.TestEntry) {\n const testUuid = this.#testContexts.get(test)?.uuid;\n\n if (!testUuid) {\n return;\n }\n\n const statusAndDetails = this.#statusAndDetails(test.errors);\n const status =\n test.failing && statusAndDetails.status === Status.BROKEN ? Status.FAILED : statusAndDetails.status;\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusAndDetails.details,\n };\n });\n this.runtime.stopTest(testUuid, { duration: test.duration ?? 0 });\n }\n\n #handleTestSkip(test: Circus.TestEntry) {\n const { cleanTitle } = extractMetadataFromString(test.name);\n const newTestFullName = this.#getTestFullName(test, cleanTitle);\n\n if (this.runContext.skippedTestsFullNamesByTestPlan.includes(newTestFullName)) {\n this.#handleTestScopeStop(test);\n return;\n }\n\n // noinspection JSPotentiallyInvalidUsageOfThis\n const testUuid = this.#handleTestStart(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.SKIPPED;\n });\n // noinspection JSPotentiallyInvalidUsageOfThis\n this.#handleTestScopeStop(test);\n }\n\n #handleTestTodo(test: Circus.TestEntry) {\n // noinspection JSPotentiallyInvalidUsageOfThis\n const testUuid = this.#handleTestStart(test);\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.SKIPPED;\n result.statusDetails = {\n message: \"TODO\",\n };\n });\n // noinspection JSPotentiallyInvalidUsageOfThis\n this.#handleTestScopeStop(test);\n }\n\n #handleRunFinish() {\n this.runtime.writeEnvironmentInfo();\n this.runtime.writeCategoriesDefinitions();\n }\n\n #statusAndDetails(errors: Circus.TestError[]): { status: Status; details: Partial<StatusDetails> } {\n if (errors.length === 0) {\n return {\n status: Status.PASSED,\n details: {},\n };\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] = errors;\n const hasMultipleErrors = Array.isArray(error);\n const exception: Circus.Exception = hasMultipleErrors ? error[0] : error;\n const firstError = this.#convertToError(exception);\n\n // in case user throws non-Error type, the first exception is the user-thrown object,\n // while the second one is provided by jest and has correct stack trace\n if (hasMultipleErrors && error.length > 1) {\n const secondError = this.#convertToError(error[1]);\n\n if (!firstError.message) {\n firstError.message = secondError.message;\n }\n\n if (!firstError.stack) {\n firstError.stack = secondError.stack;\n }\n }\n\n const details = getMessageAndTraceFromError(firstError);\n const status = getStatusFromError(firstError);\n\n return { status, details };\n }\n\n #convertToError(exception: Circus.Exception):\n | Error\n | {\n message?: string;\n stack?: string;\n } {\n if (!exception) {\n return {};\n }\n\n // user may throw an object as well\n if (typeof exception !== \"object\" || !(\"stack\" in exception)) {\n return {\n message: serialize(exception),\n };\n }\n\n return exception;\n }\n };\n};\n\nexport { createJestEnvironment };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,SAASA,QAAQ,EAAEC,GAAG,QAAQ,WAAW;AACzC,SAASC,GAAG,QAAQ,cAAc;AAIlC,OAAO,KAAKC,MAAM,MAAM,mBAAmB;AAC3C,SAASC,KAAK,EAAEC,MAAM,QAA6C,mBAAmB;AACtF,SAA+CC,SAAS,QAAQ,uBAAuB;AACvF,SACEC,yBAAyB,EACzBC,2BAA2B,EAC3BC,kBAAkB,EAClBC,SAAS,EACTC,oBAAoB,QACf,uBAAuB;AAC9B,SACEC,eAAe,EACfC,mBAAmB,EACnBC,oBAAoB,EACpBC,0BAA0B,EAC1BC,iBAAiB,EACjBC,YAAY,EACZC,gBAAgB,EAChBC,eAAe,EACfC,YAAY,EACZC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,kBAAkB,EAClBC,GAAG,EACHC,aAAa,QACR,gCAAgC;AACvC,SAASC,oBAAoB,QAAQ,+BAA+B;AAEpE,SAASC,qBAAqB,QAAQ,4BAA4B;AAElE,SAASC,SAAS,EAAEC,WAAW,EAAEC,IAAI,EAAEC,mBAAmB,QAAQ,YAAY;AAY9E,IAAMC,qBAAqB,GAA0CC,IAAO,IAAQ;EAAA,IAAAC,aAAA,EAAAC,YAAA;EAClF;EACA,OAAAD,aAAA,oBAAAE,OAAA,IAAAD,YAAA,oBAAAE,OAAA,IAAO,cAAcJ,I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
1
  {
2
2
  "name": "allure-jest",
3
- "version": "3.14.0",
3
+ "version": "3.16.0",
4
4
  "description": "Allure Jest integration",
5
5
  "keywords": [
6
6
  "allure",
@@ -50,17 +50,19 @@
50
50
  "allure-report": "allure serve ./out/allure-results",
51
51
  "clean": "rimraf ./dist ./out",
52
52
  "compile": "run-s 'compile:*'",
53
- "compile:esm-babel": "babel --config-file ./babel.esm.json ./src --out-dir ./dist/esm --extensions '.ts' --source-maps",
54
- "compile:cjs-babel": "babel --config-file ./babel.cjs.json ./src --out-dir ./dist/cjs --extensions '.ts' --source-maps",
53
+ "compile:esm-babel": "babel --config-file ./babel.esm.json ./src --out-dir ./dist/esm --extensions .ts --source-maps",
54
+ "compile:cjs-babel": "babel --config-file ./babel.cjs.json ./src --out-dir ./dist/cjs --extensions .ts --source-maps",
55
55
  "compile:types": "tsc",
56
56
  "compile:fixup": "node ./scripts/fixup.mjs",
57
57
  "generate-report": "allure generate ./out/allure-results -o ./out/allure-report --clean",
58
- "lint": "oxlint --import-plugin src test",
59
- "lint:fix": "oxlint --import-plugin --fix src test",
60
- "test": "vitest run"
58
+ "lint": "vp lint src test",
59
+ "lint:fix": "vp lint --fix src test",
60
+ "test": "run-s test:prepare test:run",
61
+ "test:prepare": "yarn workspaces foreach -R --topological-dev run compile",
62
+ "test:run": "vp test run"
61
63
  },
62
64
  "dependencies": {
63
- "allure-js-commons": "3.14.0"
65
+ "allure-js-commons": "3.16.0"
64
66
  },
65
67
  "devDependencies": {
66
68
  "@babel/cli": "^8.0.1",
@@ -68,13 +70,10 @@
68
70
  "@babel/preset-env": "^7.28.0",
69
71
  "@babel/preset-typescript": "^7.27.1",
70
72
  "@jest/environment": "^30.0.0",
71
- "@jest/expect": "^30.0.0",
72
73
  "@jest/types": "^30.0.0",
73
- "@types/babel__core": "^7.20.5",
74
- "@types/babel__preset-env": "^7.10.0",
75
74
  "@types/node": "^26.0.1",
76
75
  "allure-commandline": "^2.29.0",
77
- "allure-vitest": "3.14.0",
76
+ "allure-vitest": "3.16.0",
78
77
  "babel-plugin-add-module-exports": "^1.0.4",
79
78
  "jest-cli": "^30.0.0",
80
79
  "jest-environment-jsdom": "^30.0.0",
@@ -82,7 +81,9 @@
82
81
  "npm-run-all2": "^9.0.2",
83
82
  "rimraf": "^6.0.0",
84
83
  "typescript": "^6.0.3",
85
- "vitest": "^4.1.11"
84
+ "vite": "npm:@voidzero-dev/vite-plus-core@^8.3.8000",
85
+ "vite-plus": "^1.7.0",
86
+ "vitest": "^5.1.0"
86
87
  },
87
88
  "peerDependencies": {
88
89
  "jest": ">=24.8.0",