allure-jest 3.0.0-beta.5 → 3.0.0-beta.7

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