allure-jest 2.15.1 → 3.0.0-beta.2

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.
Files changed (52) hide show
  1. package/README.md +21 -14
  2. package/dist/cjs/AllureJestTestRuntime.js +34 -0
  3. package/dist/cjs/AllureJestTestRuntime.js.map +1 -0
  4. package/dist/cjs/environmentFactory.js +270 -0
  5. package/dist/cjs/environmentFactory.js.map +1 -0
  6. package/dist/cjs/jsdom.js +12 -0
  7. package/dist/cjs/jsdom.js.map +1 -0
  8. package/dist/cjs/model.js +2 -0
  9. package/dist/cjs/model.js.map +1 -0
  10. package/dist/cjs/node.js +12 -0
  11. package/dist/cjs/node.js.map +1 -0
  12. package/dist/cjs/package.json +3 -0
  13. package/dist/cjs/utils.js +49 -0
  14. package/dist/cjs/utils.js.map +1 -0
  15. package/dist/esm/AllureJestTestRuntime.js +27 -0
  16. package/dist/esm/AllureJestTestRuntime.js.map +1 -0
  17. package/dist/esm/environmentFactory.js +260 -0
  18. package/dist/esm/environmentFactory.js.map +1 -0
  19. package/dist/esm/jsdom.js +4 -0
  20. package/dist/esm/jsdom.js.map +1 -0
  21. package/dist/esm/model.js +2 -0
  22. package/dist/esm/model.js.map +1 -0
  23. package/dist/esm/node.js +4 -0
  24. package/dist/esm/node.js.map +1 -0
  25. package/dist/esm/package.json +3 -0
  26. package/dist/esm/utils.js +40 -0
  27. package/dist/esm/utils.js.map +1 -0
  28. package/dist/types/AllureJestTestRuntime.d.ts +10 -0
  29. package/dist/types/environmentFactory.d.ts +3 -0
  30. package/dist/types/jsdom.d.ts +2 -0
  31. package/dist/types/model.d.ts +16 -0
  32. package/dist/types/node.d.ts +2 -0
  33. package/dist/types/utils.d.ts +24 -0
  34. package/package.json +37 -42
  35. package/dist/AllureJest.d.ts +0 -15
  36. package/dist/AllureJest.js +0 -188
  37. package/dist/AllureJest.js.map +0 -1
  38. package/dist/AllureJestApi.d.ts +0 -33
  39. package/dist/AllureJestApi.js +0 -136
  40. package/dist/AllureJestApi.js.map +0 -1
  41. package/dist/index.d.ts +0 -4
  42. package/dist/index.js +0 -3
  43. package/dist/index.js.map +0 -1
  44. package/dist/jsdom.d.ts +0 -3
  45. package/dist/jsdom.js +0 -9
  46. package/dist/jsdom.js.map +0 -1
  47. package/dist/node.d.ts +0 -3
  48. package/dist/node.js +0 -9
  49. package/dist/node.js.map +0 -1
  50. package/dist/utils.d.ts +0 -4
  51. package/dist/utils.js +0 -20
  52. package/dist/utils.js.map +0 -1
package/README.md CHANGED
@@ -21,10 +21,10 @@
21
21
 
22
22
  ## Installation
23
23
 
24
- Use your favorite node package manager to install required packages:
24
+ Use your favorite node package manager to install the package:
25
25
 
26
26
  ```shell
27
- npm add -D allure-jest allure-js-commons
27
+ npm add -D allure-jest
28
28
  ```
29
29
 
30
30
  If you're using `jest` for testing `node` add following line to your `jest.config.js` file:
@@ -61,10 +61,12 @@ The plugin provides custom global commands which allow to add additional info
61
61
  inside your tests:
62
62
 
63
63
  ```javascript
64
- it("my test", () => {
65
- allure.attachment(currentTest.id(), screenshot, "image/png");
66
- allure.epic(currentTest.id(), "my_epic");
67
- allure.parameter(currentTest.id(), "parameter_name", "parameter_value", {
64
+ import { attachment, epic, parameter } from "allure-js-commons";
65
+
66
+ it("my test", async () => {
67
+ await attachment(currentTest.id(), screenshot, "image/png");
68
+ await epic(currentTest.id(), "my_epic");
69
+ await parameter(currentTest.id(), "parameter_name", "parameter_value", {
68
70
  mode: "hidden",
69
71
  excluded: false,
70
72
  });
@@ -74,9 +76,11 @@ it("my test", () => {
74
76
  ## Links usage
75
77
 
76
78
  ```js
77
- it("basic test", () => {
78
- allure.link("https://allurereport.org", "Allure Report"); // link with name
79
- allure.issue("Issue Name", "https://github.com/allure-framework/allure-js/issues/352");
79
+ import { link, issue } from "allure-js-commons";
80
+
81
+ it("basic test", async () => {
82
+ await link("https://allurereport.org", "Allure Report"); // link with name
83
+ await issue("Issue Name", "https://github.com/allure-framework/allure-js/issues/352");
80
84
  });
81
85
  ```
82
86
 
@@ -92,7 +96,8 @@ const config = {
92
96
  + links: [
93
97
  + {
94
98
  + type: "issue",
95
- + urlTemplate: "https://example.org/issues/%s"
99
+ + urlTemplate: "https://example.org/issues/%s",
100
+ + nameTemplate: "Issue: %s",
96
101
  + },
97
102
  + {
98
103
  + type: "tms",
@@ -112,10 +117,12 @@ module.exports = config
112
117
  Then you can assign link using shorter notation:
113
118
 
114
119
  ```js
115
- it("basic test", () => {
116
- allure.issue("Issue Name", "352");
117
- allure.tms("Task Name", "352");
118
- allure.link("352", "Link name", "custom");
120
+ import { issue, tms, link } from "allure-js-commons";
121
+
122
+ it("basic test", async () => {
123
+ await issue("Issue Name", "352");
124
+ await tms("Task Name", "352");
125
+ await link("352", "Link name", "custom");
119
126
  });
120
127
  ```
121
128
 
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AllureJestTestRuntime = void 0;
7
+ var _runtime = require("allure-js-commons/sdk/runtime");
8
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
9
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
10
+ class AllureJestTestRuntime extends _runtime.MessageTestRuntime {
11
+ constructor(jestEnvironment, context) {
12
+ super();
13
+ this.jestEnvironment = jestEnvironment;
14
+ this.context = context;
15
+ context.allureTestRuntime = () => this;
16
+ }
17
+ sendMessage(message) {
18
+ var _this = this;
19
+ return _asyncToGenerator(function* () {
20
+ var {
21
+ currentTestName,
22
+ currentConcurrentTestName
23
+ } = _this.context.expect.getState();
24
+ var testName = currentTestName || (currentConcurrentTestName === null || currentConcurrentTestName === void 0 ? void 0 : currentConcurrentTestName());
25
+ _this.jestEnvironment.handleAllureRuntimeMessage({
26
+ currentTestName: testName,
27
+ message
28
+ });
29
+ yield Promise.resolve();
30
+ })();
31
+ }
32
+ }
33
+ exports.AllureJestTestRuntime = AllureJestTestRuntime;
34
+ //# sourceMappingURL=AllureJestTestRuntime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AllureJestTestRuntime.js","names":["_runtime","require","asyncGeneratorStep","n","t","e","r","o","a","c","i","u","value","done","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","AllureJestTestRuntime","MessageTestRuntime","constructor","jestEnvironment","context","allureTestRuntime","sendMessage","message","_this","currentTestName","currentConcurrentTestName","expect","getState","testName","handleAllureRuntimeMessage","exports"],"sources":["../../src/AllureJestTestRuntime.ts"],"sourcesContent":["import type { JestExpect } from \"@jest/expect\";\nimport type { Global } from \"@jest/types\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport { MessageTestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport type { AllureJestEnvironment } from \"./model.js\";\n\nexport class AllureJestTestRuntime extends MessageTestRuntime {\n constructor(\n private readonly jestEnvironment: AllureJestEnvironment,\n private readonly context: Global.Global,\n ) {\n super();\n context.allureTestRuntime = () => this;\n }\n\n async sendMessage(message: RuntimeMessage) {\n const { currentTestName, currentConcurrentTestName } = (this.context.expect as JestExpect).getState();\n const testName = currentTestName || currentConcurrentTestName?.();\n\n this.jestEnvironment.handleAllureRuntimeMessage({\n currentTestName: testName as string,\n message,\n });\n\n await Promise.resolve();\n }\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAAmE,SAAAC,mBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,cAAAC,CAAA,GAAAP,CAAA,CAAAK,CAAA,EAAAC,CAAA,GAAAE,CAAA,G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ACF,CAAC,CAAC;MAEF,MAAMf,OAAO,CAACC,OAAO,CAAC,CAAC;IAAC;EAC1B;AACF;AAACsB,OAAA,CAAAf,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -0,0 +1,270 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _nodeOs = _interopRequireDefault(require("node:os"));
8
+ var _nodePath = require("node:path");
9
+ var _nodeProcess = _interopRequireDefault(require("node:process"));
10
+ var _allureJsCommons = _interopRequireWildcard(require("allure-js-commons"));
11
+ var allure = _allureJsCommons;
12
+ var _sdk = require("allure-js-commons/sdk");
13
+ var _reporter = require("allure-js-commons/sdk/reporter");
14
+ var _runtime = require("allure-js-commons/sdk/runtime");
15
+ var _AllureJestTestRuntime = require("./AllureJestTestRuntime.js");
16
+ var _utils = require("./utils.js");
17
+ var _excluded = ["resultsDir", "testMode"];
18
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
19
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
21
+ 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; }
22
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
23
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
24
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
25
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
26
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
27
+ 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); }
28
+ var {
29
+ ALLURE_HOST_NAME,
30
+ ALLURE_THREAD_NAME,
31
+ JEST_WORKER_ID
32
+ } = _nodeProcess.default.env;
33
+ var hostname = _nodeOs.default.hostname();
34
+ var createJestEnvironment = Base => {
35
+ // @ts-expect-error (ts(2545)) Incorrect assumption about a mixin class: https://github.com/microsoft/TypeScript/issues/37142
36
+ return class extends Base {
37
+ constructor(config, context) {
38
+ var _config$projectConfig;
39
+ super(config, context);
40
+ _defineProperty(this, "testPath", void 0);
41
+ _defineProperty(this, "runtime", void 0);
42
+ _defineProperty(this, "allureUuidsByTestIds", new Map());
43
+ _defineProperty(this, "handleTestEvent", (event, state) => {
44
+ switch (event.name) {
45
+ case "test_retry":
46
+ this.handleTestAdd({
47
+ testName: event.test.name,
48
+ concurrent: event.test.concurrent,
49
+ state
50
+ });
51
+ break;
52
+ case "add_test":
53
+ this.handleTestAdd({
54
+ testName: event.testName,
55
+ concurrent: event.concurrent,
56
+ state
57
+ });
58
+ break;
59
+ case "test_start":
60
+ this.handleTestStart(event.test);
61
+ break;
62
+ case "test_todo":
63
+ this.handleTestTodo(event.test);
64
+ break;
65
+ case "test_fn_success":
66
+ this.handleTestPass(event.test);
67
+ break;
68
+ case "test_fn_failure":
69
+ this.handleTestFail(event.test);
70
+ break;
71
+ case "test_skip":
72
+ this.handleTestSkip(event.test);
73
+ break;
74
+ case "test_done":
75
+ this.handleTestDone(event.test);
76
+ break;
77
+ default:
78
+ break;
79
+ }
80
+ });
81
+ var _ref = (config === null || config === void 0 || (_config$projectConfig = config.projectConfig) === null || _config$projectConfig === void 0 ? void 0 : _config$projectConfig.testEnvironmentOptions) || {},
82
+ {
83
+ resultsDir = "allure-results",
84
+ testMode = false
85
+ } = _ref,
86
+ restConfig = _objectWithoutProperties(_ref, _excluded);
87
+ this.runtime = new _reporter.ReporterRuntime(_objectSpread(_objectSpread({}, restConfig), {}, {
88
+ writer: testMode ? new _reporter.MessageWriter() : new _reporter.FileSystemWriter({
89
+ resultsDir
90
+ })
91
+ }));
92
+ this.testPath = context.testPath.replace(config.globalConfig.rootDir, "").replace(_nodePath.sep, "");
93
+
94
+ // @ts-ignore
95
+ var testRuntime = new _AllureJestTestRuntime.AllureJestTestRuntime(this, this.global);
96
+
97
+ // @ts-ignore
98
+ this.global.allure = allure;
99
+ (0, _runtime.setGlobalTestRuntime)(testRuntime);
100
+ }
101
+ setup() {
102
+ return super.setup();
103
+ }
104
+ teardown() {
105
+ return super.teardown();
106
+ }
107
+ handleAllureRuntimeMessage(payload) {
108
+ var testUuid = this.getTestUuid({
109
+ name: payload.currentTestName,
110
+ // little hack because first element in the path will be always ommited
111
+ parent: {
112
+ name: "ROOT_DESCRIBE_BLOCK"
113
+ }
114
+ });
115
+ this.runtime.applyRuntimeMessages([payload.message], {
116
+ testUuid
117
+ });
118
+ }
119
+ getTestUuid(test) {
120
+ var testPath = (0, _utils.getTestPath)(test);
121
+ var currentTestId = (0, _utils.getTestId)(testPath);
122
+ var testUuid = this.allureUuidsByTestIds.get(currentTestId);
123
+ if (!testUuid) {
124
+ // eslint-disable-next-line no-console
125
+ console.error("Can't find \"".concat(currentTestId, "\" test while tried to start it!"));
126
+ return undefined;
127
+ }
128
+ return testUuid;
129
+ }
130
+ handleTestAdd(payload) {
131
+ var {
132
+ testName,
133
+ state
134
+ } = payload;
135
+ var {
136
+ currentDescribeBlock
137
+ } = state;
138
+ var newTestSuitesPath = (0, _utils.getTestPath)(currentDescribeBlock);
139
+ var newTestPath = newTestSuitesPath.concat(testName);
140
+ var newTestId = (0, _utils.getTestId)(newTestPath);
141
+ var threadLabel = ALLURE_THREAD_NAME || JEST_WORKER_ID || _nodeProcess.default.pid.toString();
142
+ var hostLabel = ALLURE_HOST_NAME || hostname;
143
+ var packageLabel = (0, _nodePath.dirname)(this.testPath).split(_nodePath.sep).join(".");
144
+ var testUuid = this.runtime.startTest({
145
+ name: testName,
146
+ fullName: newTestId,
147
+ labels: [{
148
+ name: _allureJsCommons.LabelName.LANGUAGE,
149
+ value: "javascript"
150
+ }, {
151
+ name: _allureJsCommons.LabelName.FRAMEWORK,
152
+ value: "jest"
153
+ }, {
154
+ name: _allureJsCommons.LabelName.PACKAGE,
155
+ value: packageLabel
156
+ }]
157
+ });
158
+ this.runtime.updateTest(result => {
159
+ if (threadLabel) {
160
+ result.labels.push({
161
+ name: _allureJsCommons.LabelName.THREAD,
162
+ value: threadLabel
163
+ });
164
+ }
165
+ if (hostLabel) {
166
+ result.labels.push({
167
+ name: _allureJsCommons.LabelName.HOST,
168
+ value: hostLabel
169
+ });
170
+ }
171
+ result.labels.push(...(0, _reporter.getSuiteLabels)(newTestSuitesPath));
172
+ }, testUuid);
173
+
174
+ /**
175
+ * If user have some tests with the same name, reporter will throw an error due the test with
176
+ * the same name could be removed from the running tests, so better to throw an explicit error
177
+ */
178
+ if (this.allureUuidsByTestIds.has(newTestId)) {
179
+ // eslint-disable-next-line no-console
180
+ console.error("Test \"".concat(newTestId, "\" has been already initialized! To continue with reporting, please rename the test."));
181
+ return;
182
+ }
183
+ this.allureUuidsByTestIds.set(newTestId, testUuid);
184
+ }
185
+ handleTestStart(test) {
186
+ var testUuid = this.getTestUuid(test);
187
+ if (!testUuid) {
188
+ return;
189
+ }
190
+ this.runtime.updateTest(result => {
191
+ result.stage = _allureJsCommons.Stage.RUNNING;
192
+ }, testUuid);
193
+ }
194
+ handleTestPass(test) {
195
+ var testUuid = this.getTestUuid(test);
196
+ if (!testUuid) {
197
+ return;
198
+ }
199
+ this.runtime.updateTest(result => {
200
+ result.stage = _allureJsCommons.Stage.FINISHED;
201
+ result.status = _allureJsCommons.Status.PASSED;
202
+ }, testUuid);
203
+ }
204
+ handleTestFail(test) {
205
+ var testUuid = this.getTestUuid(test);
206
+ if (!testUuid) {
207
+ return;
208
+ }
209
+
210
+ // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed
211
+ var [error] = test.errors;
212
+ var hasMultipleErrors = Array.isArray(error);
213
+ var firstError = hasMultipleErrors ? error[0] : error;
214
+ var details = (0, _sdk.getMessageAndTraceFromError)(firstError);
215
+ var status = (0, _sdk.getStatusFromError)(firstError);
216
+ this.runtime.updateTest(result => {
217
+ result.stage = _allureJsCommons.Stage.FINISHED;
218
+ result.status = status;
219
+ result.statusDetails = _objectSpread({}, details);
220
+ }, testUuid);
221
+ }
222
+ handleTestSkip(test) {
223
+ var testUuid = this.getTestUuid(test);
224
+ if (!testUuid) {
225
+ return;
226
+ }
227
+ this.runtime.updateTest(result => {
228
+ result.stage = _allureJsCommons.Stage.PENDING;
229
+ result.status = _allureJsCommons.Status.SKIPPED;
230
+ }, testUuid);
231
+ this.runtime.stopTest({
232
+ uuid: testUuid
233
+ });
234
+ this.runtime.writeTest(testUuid);
235
+ // TODO:
236
+ this.allureUuidsByTestIds.delete((0, _utils.getTestId)((0, _utils.getTestPath)(test)));
237
+ }
238
+ handleTestDone(test) {
239
+ var testUuid = this.getTestUuid(test);
240
+ if (!testUuid) {
241
+ return;
242
+ }
243
+ this.runtime.stopTest({
244
+ uuid: testUuid
245
+ });
246
+ this.runtime.writeTest(testUuid);
247
+ // TODO:
248
+ this.allureUuidsByTestIds.delete((0, _utils.getTestId)((0, _utils.getTestPath)(test)));
249
+ }
250
+ handleTestTodo(test) {
251
+ var testUuid = this.getTestUuid(test);
252
+ if (!testUuid) {
253
+ return;
254
+ }
255
+ this.runtime.updateTest(result => {
256
+ result.stage = _allureJsCommons.Stage.PENDING;
257
+ result.status = _allureJsCommons.Status.SKIPPED;
258
+ }, testUuid);
259
+ this.runtime.stopTest({
260
+ uuid: testUuid
261
+ });
262
+ this.runtime.writeTest(testUuid);
263
+ // TODO:
264
+ this.allureUuidsByTestIds.delete((0, _utils.getTestId)((0, _utils.getTestPath)(test)));
265
+ }
266
+ };
267
+ };
268
+ var _default = exports.default = createJestEnvironment;
269
+ module.exports = exports.default;
270
+ //# sourceMappingURL=environmentFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environmentFactory.js","names":["_nodeOs","_interopRequireDefault","require","_nodePath","_nodeProcess","_allureJsCommons","_interopRequireWildcard","allure","_sdk","_reporter","_runtime","_AllureJestTestRuntime","_utils","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_objectWithoutProperties","_objectWithoutPropertiesLoose","indexOf","propertyIsEnumerable","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","ALLURE_HOST_NAME","ALLURE_THREAD_NAME","JEST_WORKER_ID","process","env","hostname","os","createJestEnvironment","Base","constructor","config","context","_config$projectConfig","Map","event","state","name","handleTestAdd","testName","test","concurrent","handleTestStart","handleTestTodo","handleTestPass","handleTestFail","handleTestSkip","handleTestDone","_ref","projectConfig","testEnvironmentOptions","resultsDir","testMode","restConfig","runtime","ReporterRuntime","writer","MessageWriter","FileSystemWriter","testPath","replace","globalConfig","rootDir","sep","testRuntime","AllureJestTestRuntime","global","setGlobalTestRuntime","setup","teardown","handleAllureRuntimeMessage","payload","testUuid","getTestUuid","currentTestName","parent","applyRuntimeMessages","message","getTestPath","currentTestId","getTestId","allureUuidsByTestIds","console","error","concat","undefined","currentDescribeBlock","newTestSuitesPath","newTestPath","newTestId","threadLabel","pid","toString","hostLabel","packageLabel","dirname","split","join","startTest","fullName","labels","LabelName","LANGUAGE","FRAMEWORK","PACKAGE","updateTest","result","THREAD","HOST","getSuiteLabels","stage","Stage","RUNNING","FINISHED","status","Status","PASSED","errors","hasMultipleErrors","Array","isArray","firstError","details","getMessageAndTraceFromError","getStatusFromError","statusDetails","PENDING","SKIPPED","stopTest","uuid","writeTest","delete","_default","exports","module"],"sources":["../../src/environmentFactory.ts"],"sourcesContent":["import type { EnvironmentContext, JestEnvironment } from \"@jest/environment\";\nimport type { Circus } from \"@jest/types\";\nimport os from \"node:os\";\nimport { dirname, sep } from \"node:path\";\nimport process from \"node:process\";\nimport * as allure from \"allure-js-commons\";\nimport { LabelName, Stage, Status } from \"allure-js-commons\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport { getMessageAndTraceFromError, getStatusFromError } from \"allure-js-commons/sdk\";\nimport { FileSystemWriter, MessageWriter, ReporterRuntime, getSuiteLabels } from \"allure-js-commons/sdk/reporter\";\nimport { setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport { AllureJestTestRuntime } from \"./AllureJestTestRuntime.js\";\nimport type { AllureJestConfig, AllureJestEnvironment } from \"./model.js\";\nimport { getTestId, getTestPath } from \"./utils.js\";\n\nconst { ALLURE_HOST_NAME, ALLURE_THREAD_NAME, JEST_WORKER_ID } = process.env;\nconst hostname = os.hostname();\n\nconst createJestEnvironment = <T extends typeof JestEnvironment>(Base: T): T => {\n // @ts-expect-error (ts(2545)) Incorrect assumption about a mixin class: https://github.com/microsoft/TypeScript/issues/37142\n return class extends Base {\n testPath: string;\n runtime: ReporterRuntime;\n allureUuidsByTestIds: Map<string, string> = new Map();\n\n constructor(config: AllureJestConfig, context: EnvironmentContext) {\n super(config, context);\n\n const {\n resultsDir = \"allure-results\",\n testMode = false,\n ...restConfig\n } = config?.projectConfig?.testEnvironmentOptions || {};\n\n this.runtime = new ReporterRuntime({\n ...restConfig,\n writer: testMode\n ? new MessageWriter()\n : new FileSystemWriter({\n resultsDir,\n }),\n });\n this.testPath = context.testPath.replace(config.globalConfig.rootDir, \"\").replace(sep, \"\");\n\n // @ts-ignore\n const testRuntime = new AllureJestTestRuntime(this as AllureJestEnvironment, this.global);\n\n // @ts-ignore\n this.global.allure = allure;\n\n setGlobalTestRuntime(testRuntime);\n }\n\n setup() {\n return super.setup();\n }\n\n teardown() {\n return super.teardown();\n }\n\n handleAllureRuntimeMessage(payload: { currentTestName: string; message: RuntimeMessage }) {\n const testUuid = this.getTestUuid({\n name: payload.currentTestName,\n // little hack because first element in the path will be always ommited\n parent: { name: \"ROOT_DESCRIBE_BLOCK\" },\n } as Circus.TestEntry)!;\n\n this.runtime.applyRuntimeMessages([payload.message], { testUuid });\n }\n\n private getTestUuid(test: Circus.TestEntry) {\n const testPath = getTestPath(test);\n const currentTestId = getTestId(testPath);\n const testUuid = this.allureUuidsByTestIds.get(currentTestId);\n\n if (!testUuid) {\n // eslint-disable-next-line no-console\n console.error(`Can't find \"${currentTestId}\" test while tried to start it!`);\n return undefined;\n }\n\n return testUuid;\n }\n\n handleTestEvent = (event: Circus.Event, state: Circus.State) => {\n switch (event.name) {\n case \"test_retry\":\n this.handleTestAdd({\n testName: event.test.name,\n concurrent: event.test.concurrent,\n state,\n });\n break;\n case \"add_test\":\n this.handleTestAdd({\n testName: event.testName,\n concurrent: event.concurrent,\n state,\n });\n break;\n case \"test_start\":\n this.handleTestStart(event.test);\n break;\n case \"test_todo\":\n this.handleTestTodo(event.test);\n break;\n case \"test_fn_success\":\n this.handleTestPass(event.test);\n break;\n case \"test_fn_failure\":\n this.handleTestFail(event.test);\n break;\n case \"test_skip\":\n this.handleTestSkip(event.test);\n break;\n case \"test_done\":\n this.handleTestDone(event.test);\n break;\n default:\n break;\n }\n };\n\n private handleTestAdd(payload: { testName: string; concurrent: boolean; state: Circus.State }) {\n const { testName, state } = payload;\n const { currentDescribeBlock } = state;\n const newTestSuitesPath = getTestPath(currentDescribeBlock);\n const newTestPath = newTestSuitesPath.concat(testName);\n const newTestId = getTestId(newTestPath);\n const threadLabel = ALLURE_THREAD_NAME || JEST_WORKER_ID || process.pid.toString();\n const hostLabel = ALLURE_HOST_NAME || hostname;\n const packageLabel = dirname(this.testPath).split(sep).join(\".\");\n const testUuid = this.runtime.startTest({\n name: testName,\n fullName: newTestId,\n labels: [\n {\n name: LabelName.LANGUAGE,\n value: \"javascript\",\n },\n {\n name: LabelName.FRAMEWORK,\n value: \"jest\",\n },\n {\n name: LabelName.PACKAGE,\n value: packageLabel,\n },\n ],\n });\n\n this.runtime.updateTest((result) => {\n if (threadLabel) {\n result.labels.push({ name: LabelName.THREAD, value: threadLabel });\n }\n\n if (hostLabel) {\n result.labels.push({ name: LabelName.HOST, value: hostLabel });\n }\n\n result.labels.push(...getSuiteLabels(newTestSuitesPath));\n }, testUuid);\n\n /**\n * If user have some tests with the same name, reporter will throw an error due the test with\n * the same name could be removed from the running tests, so better to throw an explicit error\n */\n if (this.allureUuidsByTestIds.has(newTestId)) {\n // eslint-disable-next-line no-console\n console.error(\n `Test \"${newTestId}\" has been already initialized! To continue with reporting, please rename the test.`,\n );\n return;\n }\n\n this.allureUuidsByTestIds.set(newTestId, testUuid as string);\n }\n\n private handleTestStart(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.RUNNING;\n }, testUuid);\n }\n\n private handleTestPass(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.PASSED;\n }, testUuid);\n }\n\n private handleTestFail(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed\n const [error] = test.errors;\n const hasMultipleErrors = Array.isArray(error);\n const firstError: Error = hasMultipleErrors ? error[0] : error;\n const details = getMessageAndTraceFromError(firstError);\n const status = getStatusFromError(firstError);\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.FINISHED;\n result.status = status;\n result.statusDetails = {\n ...details,\n };\n }, testUuid);\n }\n\n private handleTestSkip(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.PENDING;\n result.status = Status.SKIPPED;\n }, testUuid);\n this.runtime.stopTest({ uuid: testUuid });\n this.runtime.writeTest(testUuid);\n // TODO:\n this.allureUuidsByTestIds.delete(getTestId(getTestPath(test)));\n }\n\n private handleTestDone(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.stopTest({ uuid: testUuid });\n this.runtime.writeTest(testUuid);\n // TODO:\n this.allureUuidsByTestIds.delete(getTestId(getTestPath(test)));\n }\n\n private handleTestTodo(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.PENDING;\n result.status = Status.SKIPPED;\n }, testUuid);\n\n this.runtime.stopTest({ uuid: testUuid });\n this.runtime.writeTest(testUuid);\n // TODO:\n this.allureUuidsByTestIds.delete(getTestId(getTestPath(test)));\n }\n };\n};\n\nexport default createJestEnvironment;\n"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,gBAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAA4C,IAAAK,MAAA,GAAAF,gBAAA;AAG5C,IAAAG,IAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,sBAAA,GAAAT,OAAA;AAEA,IAAAU,MAAA,GAAAV,OAAA;AAAoD,IAAAW,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAA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AA,CAAAD,OAAA,GAAAA,OAAA,CAAA3J,OAAA","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _jestEnvironmentJsdom = require("jest-environment-jsdom");
8
+ var _environmentFactory = _interopRequireDefault(require("./environmentFactory.js"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ var _default = exports.default = (0, _environmentFactory.default)(_jestEnvironmentJsdom.TestEnvironment);
11
+ module.exports = exports.default;
12
+ //# sourceMappingURL=jsdom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsdom.js","names":["_jestEnvironmentJsdom","require","_environmentFactory","_interopRequireDefault","e","__esModule","default","_default","exports","createJestEnvironment","TestEnvironment","module"],"sources":["../../src/jsdom.ts"],"sourcesContent":["import { TestEnvironment } from \"jest-environment-jsdom\";\nimport createJestEnvironment from \"./environmentFactory.js\";\n\nexport default createJestEnvironment(TestEnvironment);\n"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA4D,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE7C,IAAAG,2BAAqB,EAACC,qCAAe,CAAC;AAAAC,MAAA,CAAAH,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","names":[],"sources":["../../src/model.ts"],"sourcesContent":["import type { JestEnvironment, JestEnvironmentConfig } from \"@jest/environment\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport type { Config } from \"allure-js-commons/sdk/reporter\";\n\nexport interface AllureJestEnvironment extends JestEnvironment {\n handleAllureRuntimeMessage(payload: { currentTestName: string; message: RuntimeMessage }): void;\n}\n\nexport interface AllureJestConfig extends JestEnvironmentConfig {\n projectConfig: JestEnvironmentConfig[\"projectConfig\"] & {\n testEnvironmentOptions?: JestEnvironmentConfig[\"projectConfig\"][\"testEnvironmentOptions\"] &\n Config & {\n testMode?: boolean;\n };\n };\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _jestEnvironmentNode = require("jest-environment-node");
8
+ var _environmentFactory = _interopRequireDefault(require("./environmentFactory.js"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ var _default = exports.default = (0, _environmentFactory.default)(_jestEnvironmentNode.TestEnvironment);
11
+ module.exports = exports.default;
12
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","names":["_jestEnvironmentNode","require","_environmentFactory","_interopRequireDefault","e","__esModule","default","_default","exports","createJestEnvironment","TestEnvironment","module"],"sources":["../../src/node.ts"],"sourcesContent":["import { TestEnvironment } from \"jest-environment-node\";\nimport createJestEnvironment from \"./environmentFactory.js\";\n\nexport default createJestEnvironment(TestEnvironment);\n"],"mappings":";;;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA4D,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE7C,IAAAG,2BAAqB,EAACC,oCAAe,CAAC;AAAAC,MAAA,CAAAH,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getTestPath = exports.getTestId = exports.getTestFullName = void 0;
7
+ /**
8
+ * Returns array of names which represents full test hierarchy
9
+ * Omits ROOT_DESCRIBE_BLOCK because it shouldn't be reported
10
+ *
11
+ * @param test Test or describe block
12
+ * @returns
13
+ */
14
+ var getTestPath = test => {
15
+ var path = [];
16
+ var currentUnit = test;
17
+ while (currentUnit) {
18
+ if (currentUnit.name) {
19
+ path.unshift(currentUnit.name);
20
+ }
21
+ currentUnit = currentUnit.parent;
22
+ }
23
+
24
+ // debugger
25
+
26
+ // first element is always ROOT_DESCRIBE_BLOCK, which shouldn't be reported
27
+ return path.slice(1);
28
+ };
29
+
30
+ /**
31
+ * Returns starndartized test name what can be used as test Id
32
+ *
33
+ * @doc https://github.com/jestjs/jest/blob/25a8785584c9d54a05887001ee7f498d489a5441/packages/jest-circus/src/utils.ts#L410
34
+ * @param path Path memebers
35
+ * @returns
36
+ */
37
+ exports.getTestPath = getTestPath;
38
+ var getTestId = path => path.join(" ");
39
+
40
+ /**
41
+ * Returns test full name (test hierarchy joined by " > ")
42
+ *
43
+ * @param path Path memebers
44
+ * @returns
45
+ */
46
+ exports.getTestId = getTestId;
47
+ var getTestFullName = path => path.join(" > ");
48
+ exports.getTestFullName = getTestFullName;
49
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","names":["getTestPath","test","path","currentUnit","name","unshift","parent","slice","exports","getTestId","join","getTestFullName"],"sources":["../../src/utils.ts"],"sourcesContent":["import type { Circus } from \"@jest/types\";\n\n/**\n * Returns array of names which represents full test hierarchy\n * Omits ROOT_DESCRIBE_BLOCK because it shouldn't be reported\n *\n * @param test Test or describe block\n * @returns\n */\nexport const getTestPath = (test: Circus.TestEntry | Circus.DescribeBlock): string[] => {\n const path = [];\n let currentUnit: Circus.DescribeBlock | Circus.TestEntry | undefined = test;\n\n while (currentUnit) {\n if (currentUnit.name) {\n path.unshift(currentUnit.name);\n }\n\n currentUnit = currentUnit.parent;\n }\n\n // debugger\n\n // first element is always ROOT_DESCRIBE_BLOCK, which shouldn't be reported\n return path.slice(1);\n};\n\n/**\n * Returns starndartized test name what can be used as test Id\n *\n * @doc https://github.com/jestjs/jest/blob/25a8785584c9d54a05887001ee7f498d489a5441/packages/jest-circus/src/utils.ts#L410\n * @param path Path memebers\n * @returns\n */\nexport const getTestId = (path: string[]): string => path.join(\" \");\n\n/**\n * Returns test full name (test hierarchy joined by \" > \")\n *\n * @param path Path memebers\n * @returns\n */\nexport const getTestFullName = (path: string[]): string => path.join(\" > \");\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,WAAW,GAAIC,IAA6C,IAAe;EACtF,IAAMC,IAAI,GAAG,EAAE;EACf,IAAIC,WAAgE,GAAGF,IAAI;EAE3E,OAAOE,WAAW,EAAE;IAClB,IAAIA,WAAW,CAACC,IAAI,EAAE;MACpBF,IAAI,CAACG,OAAO,CAACF,WAAW,CAACC,IAAI,CAAC;IAChC;IAEAD,WAAW,GAAGA,WAAW,CAACG,MAAM;EAClC;;EAEA;;EAEA;EACA,OAAOJ,IAAI,CAACK,KAAK,CAAC,CAAC,CAAC;AACtB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANAC,OAAA,CAAAR,WAAA,GAAAA,WAAA;AAOO,IAAMS,SAAS,GAAIP,IAAc,IAAaA,IAAI,CAACQ,IAAI,CAAC,GAAG,CAAC;;AAEnE;AACA;AACA;AACA;AACA;AACA;AALAF,OAAA,CAAAC,SAAA,GAAAA,SAAA;AAMO,IAAME,eAAe,GAAIT,IAAc,IAAaA,IAAI,CAACQ,IAAI,CAAC,KAAK,CAAC;AAACF,OAAA,CAAAG,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
2
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
3
+ import { MessageTestRuntime } from "allure-js-commons/sdk/runtime";
4
+ export class AllureJestTestRuntime extends MessageTestRuntime {
5
+ constructor(jestEnvironment, context) {
6
+ super();
7
+ this.jestEnvironment = jestEnvironment;
8
+ this.context = context;
9
+ context.allureTestRuntime = () => this;
10
+ }
11
+ sendMessage(message) {
12
+ var _this = this;
13
+ return _asyncToGenerator(function* () {
14
+ var {
15
+ currentTestName,
16
+ currentConcurrentTestName
17
+ } = _this.context.expect.getState();
18
+ var testName = currentTestName || (currentConcurrentTestName === null || currentConcurrentTestName === void 0 ? void 0 : currentConcurrentTestName());
19
+ _this.jestEnvironment.handleAllureRuntimeMessage({
20
+ currentTestName: testName,
21
+ message
22
+ });
23
+ yield Promise.resolve();
24
+ })();
25
+ }
26
+ }
27
+ //# sourceMappingURL=AllureJestTestRuntime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AllureJestTestRuntime.js","names":["MessageTestRuntime","AllureJestTestRuntime","constructor","jestEnvironment","context","allureTestRuntime","sendMessage","message","_this","_asyncToGenerator","currentTestName","currentConcurrentTestName","expect","getState","testName","handleAllureRuntimeMessage","Promise","resolve"],"sources":["../../src/AllureJestTestRuntime.ts"],"sourcesContent":["import type { JestExpect } from \"@jest/expect\";\nimport type { Global } from \"@jest/types\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport { MessageTestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport type { AllureJestEnvironment } from \"./model.js\";\n\nexport class AllureJestTestRuntime extends MessageTestRuntime {\n constructor(\n private readonly jestEnvironment: AllureJestEnvironment,\n private readonly context: Global.Global,\n ) {\n super();\n context.allureTestRuntime = () => this;\n }\n\n async sendMessage(message: RuntimeMessage) {\n const { currentTestName, currentConcurrentTestName } = (this.context.expect as JestExpect).getState();\n const testName = currentTestName || currentConcurrentTestName?.();\n\n this.jestEnvironment.handleAllureRuntimeMessage({\n currentTestName: testName as string,\n message,\n });\n\n await Promise.resolve();\n }\n}\n"],"mappings":";;AAGA,SAASA,kBAAkB,QAAQ,+BAA+B;AAGlE,OAAO,MAAMC,qBAAqB,SAASD,kBAAkB,CAAC;EAC5DE,WAAWA,CACQC,eAAsC,EACtCC,OAAsB,EACvC;IACA,KAAK,CAAC,CAAC;IAAC,KAHSD,eAAsC,GAAtCA,eAAsC;IAAA,KACtCC,OAAsB,GAAtBA,OAAsB;IAGvCA,OAAO,CAACC,iBAAiB,GAAG,MAAM,IAAI;EACxC;EAEMC,WAAWA,CAACC,OAAuB,EAAE;IAAA,IAAAC,KAAA;IAAA,OAAAC,iBAAA;MACzC,IAAM;QAAEC,eAAe;QAAEC;MAA0B,CAAC,GAAIH,KAAI,CAACJ,OAAO,CAACQ,MAAM,CAAgBC,QAAQ,CAAC,CAAC;MACrG,IAAMC,QAAQ,GAAGJ,eAAe,KAAIC,yBAAyB,aAAzBA,yBAAyB,uBAAzBA,yBAAyB,CAAG,CAAC;MAEjEH,KAAI,CAACL,eAAe,CAACY,0BAA0B,CAAC;QAC9CL,eAAe,EAAEI,QAAkB;QACnCP;MACF,CAAC,CAAC;MAEF,MAAMS,OAAO,CAACC,OAAO,CAAC,CAAC;IAAC;EAC1B;AACF","ignoreList":[]}