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

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":[]}
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _nodeOs = _interopRequireDefault(require("node:os"));
8
7
  var _nodePath = require("node:path");
9
- var _nodeProcess = _interopRequireDefault(require("node:process"));
8
+ var _nodeProcess = require("node:process");
10
9
  var _allureJsCommons = _interopRequireWildcard(require("allure-js-commons"));
11
10
  var allure = _allureJsCommons;
12
11
  var _sdk = require("allure-js-commons/sdk");
@@ -14,82 +13,92 @@ var _reporter = require("allure-js-commons/sdk/reporter");
14
13
  var _runtime = require("allure-js-commons/sdk/runtime");
15
14
  var _AllureJestTestRuntime = require("./AllureJestTestRuntime.js");
16
15
  var _utils = require("./utils.js");
17
- var _excluded = ["resultsDir", "testMode"];
16
+ var _excluded = ["resultsDir"];
18
17
  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
18
  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
19
  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
20
  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
21
  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
22
  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; }
23
+ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
24
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
25
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
26
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
27
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();
28
+ 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"); }
34
29
  var createJestEnvironment = Base => {
30
+ var _Class_brand;
35
31
  // @ts-expect-error (ts(2545)) Incorrect assumption about a mixin class: https://github.com/microsoft/TypeScript/issues/37142
36
- return class extends Base {
32
+ return _Class_brand = /*#__PURE__*/new WeakSet(), class extends Base {
33
+ // config is AllureJestConfig in Jest v28 or greater. In older versions
34
+ // it's AllureJestProjectConfig. See https://github.com/jestjs/jest/pull/12461
37
35
  constructor(config, context) {
38
- var _config$projectConfig;
39
36
  super(config, context);
37
+ _classPrivateMethodInitSpec(this, _Class_brand);
40
38
  _defineProperty(this, "testPath", void 0);
39
+ _defineProperty(this, "testPlan", void 0);
41
40
  _defineProperty(this, "runtime", void 0);
42
- _defineProperty(this, "allureUuidsByTestIds", new Map());
43
- _defineProperty(this, "handleTestEvent", (event, state) => {
41
+ _defineProperty(this, "runContext", {
42
+ executables: [],
43
+ steps: [],
44
+ scopes: [],
45
+ skippedTestsFullNamesByTestPlan: []
46
+ });
47
+ _defineProperty(this, "handleTestEvent", event => {
44
48
  switch (event.name) {
45
- case "test_retry":
46
- this.handleTestAdd({
47
- testName: event.test.name,
48
- concurrent: event.test.concurrent,
49
- state
50
- });
49
+ case "hook_start":
50
+ _assertClassBrand(_Class_brand, this, _handleHookStart).call(this, event.hook);
51
+ break;
52
+ case "hook_success":
53
+ _assertClassBrand(_Class_brand, this, _handleHookPass).call(this, event.hook);
54
+ break;
55
+ case "hook_failure":
56
+ _assertClassBrand(_Class_brand, this, _handleHookFail).call(this, event.hook, event.error);
57
+ break;
58
+ case "run_describe_start":
59
+ _assertClassBrand(_Class_brand, this, _handleSuiteStart).call(this);
51
60
  break;
52
- case "add_test":
53
- this.handleTestAdd({
54
- testName: event.testName,
55
- concurrent: event.concurrent,
56
- state
57
- });
61
+ case "run_describe_finish":
62
+ _assertClassBrand(_Class_brand, this, _handleSuiteEnd).call(this);
58
63
  break;
59
64
  case "test_start":
60
- this.handleTestStart(event.test);
65
+ _assertClassBrand(_Class_brand, this, _handleTestStart).call(this, event.test);
66
+ break;
67
+ case "test_done":
68
+ _assertClassBrand(_Class_brand, this, _handleTestDone).call(this);
61
69
  break;
62
70
  case "test_todo":
63
- this.handleTestTodo(event.test);
71
+ _assertClassBrand(_Class_brand, this, _handleTestTodo).call(this, event.test);
64
72
  break;
65
73
  case "test_fn_success":
66
- this.handleTestPass(event.test);
74
+ _assertClassBrand(_Class_brand, this, _handleTestPass).call(this, event.test);
67
75
  break;
68
76
  case "test_fn_failure":
69
- this.handleTestFail(event.test);
77
+ _assertClassBrand(_Class_brand, this, _handleTestFail).call(this, event.test);
70
78
  break;
71
79
  case "test_skip":
72
- this.handleTestSkip(event.test);
80
+ _assertClassBrand(_Class_brand, this, _handleTestSkip).call(this, event.test);
73
81
  break;
74
- case "test_done":
75
- this.handleTestDone(event.test);
82
+ case "run_finish":
83
+ _assertClassBrand(_Class_brand, this, _handleRunFinish).call(this);
76
84
  break;
77
85
  default:
78
86
  break;
79
87
  }
80
88
  });
81
- var _ref = (config === null || config === void 0 || (_config$projectConfig = config.projectConfig) === null || _config$projectConfig === void 0 ? void 0 : _config$projectConfig.testEnvironmentOptions) || {},
89
+ var projectConfig = "projectConfig" in config ? config.projectConfig : config;
90
+ var _ref = (projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.testEnvironmentOptions) || {},
82
91
  {
83
- resultsDir = "allure-results",
84
- testMode = false
92
+ resultsDir
85
93
  } = _ref,
86
94
  restConfig = _objectWithoutProperties(_ref, _excluded);
87
95
  this.runtime = new _reporter.ReporterRuntime(_objectSpread(_objectSpread({}, restConfig), {}, {
88
- writer: testMode ? new _reporter.MessageWriter() : new _reporter.FileSystemWriter({
96
+ writer: (0, _reporter.createDefaultWriter)({
89
97
  resultsDir
90
98
  })
91
99
  }));
92
- this.testPath = context.testPath.replace(config.globalConfig.rootDir, "").replace(_nodePath.sep, "");
100
+ this.testPath = context.testPath.replace(projectConfig.rootDir, "").replace(_nodePath.sep, "");
101
+ this.testPlan = (0, _reporter.parseTestPlan)();
93
102
 
94
103
  // @ts-ignore
95
104
  var testRuntime = new _AllureJestTestRuntime.AllureJestTestRuntime(this, this.global);
@@ -104,166 +113,172 @@ var createJestEnvironment = Base => {
104
113
  teardown() {
105
114
  return super.teardown();
106
115
  }
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
- });
116
+ handleAllureRuntimeMessage(message) {
117
+ var executableUuid = (0, _utils.last)(this.runContext.executables);
118
+ this.runtime.applyRuntimeMessages(executableUuid, [message]);
118
119
  }
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;
120
+ };
121
+ function _getTestFullName(test) {
122
+ var newTestSuitePath = (0, _utils.getTestPath)(test.parent);
123
+ var newTestPath = newTestSuitePath.concat(test.name);
124
+ var newTestId = (0, _utils.getTestId)(newTestPath);
125
+ return "".concat(this.testPath, "#").concat(newTestId);
126
+ }
127
+ function _handleSuiteStart() {
128
+ _assertClassBrand(_Class_brand, this, _startScope).call(this);
129
+ }
130
+ function _handleSuiteEnd() {
131
+ _assertClassBrand(_Class_brand, this, _stopScope).call(this);
132
+ }
133
+ function _handleHookStart(hook) {
134
+ if ((0, _utils.shouldHookBeSkipped)(hook)) {
135
+ return;
129
136
  }
130
- handleTestAdd(payload) {
131
- var {
132
- testName,
133
- state
134
- } = payload;
135
- var {
136
- currentDescribeBlock
137
- } = state;
138
- var newTestSuitesPath = (0, _utils.getTestPath)(currentDescribeBlock);
139
- var newTestPath = newTestSuitesPath.concat(testName);
140
- var newTestId = (0, _utils.getTestId)(newTestPath);
141
- var threadLabel = ALLURE_THREAD_NAME || JEST_WORKER_ID || _nodeProcess.default.pid.toString();
142
- var hostLabel = ALLURE_HOST_NAME || hostname;
143
- var packageLabel = (0, _nodePath.dirname)(this.testPath).split(_nodePath.sep).join(".");
144
- var testUuid = this.runtime.startTest({
145
- name: testName,
146
- fullName: newTestId,
147
- labels: [{
148
- name: _allureJsCommons.LabelName.LANGUAGE,
149
- value: "javascript"
150
- }, {
151
- name: _allureJsCommons.LabelName.FRAMEWORK,
152
- value: "jest"
153
- }, {
154
- name: _allureJsCommons.LabelName.PACKAGE,
155
- value: packageLabel
156
- }]
157
- });
158
- this.runtime.updateTest(result => {
159
- if (threadLabel) {
160
- result.labels.push({
161
- name: _allureJsCommons.LabelName.THREAD,
162
- value: threadLabel
163
- });
164
- }
165
- if (hostLabel) {
166
- result.labels.push({
167
- name: _allureJsCommons.LabelName.HOST,
168
- value: hostLabel
169
- });
170
- }
171
- result.labels.push(...(0, _reporter.getSuitesLabels)(newTestSuitesPath));
172
- }, testUuid);
173
-
174
- /**
175
- * If user have some tests with the same name, reporter will throw an error due the test with
176
- * the same name could be removed from the running tests, so better to throw an explicit error
177
- */
178
- if (this.allureUuidsByTestIds.has(newTestId)) {
179
- // eslint-disable-next-line no-console
180
- console.error("Test \"".concat(newTestId, "\" has been already initialized! To continue with reporting, please rename the test."));
181
- return;
182
- }
183
- this.allureUuidsByTestIds.set(newTestId, testUuid);
137
+ var scopeUuid = (0, _utils.last)(this.runContext.scopes);
138
+ var fixtureUuid = this.runtime.startFixture(scopeUuid, /after/i.test(hook.type) ? "after" : "before", {
139
+ name: hook.type
140
+ });
141
+ this.runContext.executables.push(fixtureUuid);
142
+ }
143
+ function _handleHookPass(hook) {
144
+ if ((0, _utils.shouldHookBeSkipped)(hook)) {
145
+ return;
184
146
  }
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);
147
+ var fixtureUuid = this.runContext.executables.pop();
148
+ this.runtime.updateFixture(fixtureUuid, r => {
149
+ r.status = _allureJsCommons.Status.PASSED;
150
+ r.stage = _allureJsCommons.Stage.FINISHED;
151
+ });
152
+ this.runtime.stopFixture(fixtureUuid);
153
+ }
154
+ function _handleHookFail(hook, error) {
155
+ if ((0, _utils.shouldHookBeSkipped)(hook)) {
156
+ return;
193
157
  }
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);
158
+ var fixtureUuid = this.runContext.executables.pop();
159
+ var status = typeof error === "string" ? _allureJsCommons.Status.BROKEN : (0, _sdk.getStatusFromError)(error);
160
+ this.runtime.updateFixture(fixtureUuid, r => {
161
+ r.status = status;
162
+ r.statusDetails = {
163
+ message: typeof error === "string" ? error : error.message,
164
+ trace: typeof error === "string" ? undefined : error.stack
165
+ };
166
+ r.stage = _allureJsCommons.Stage.FINISHED;
167
+ });
168
+ this.runtime.stopFixture(fixtureUuid);
169
+ }
170
+ function _startTest(test) {
171
+ var _test$startedAt;
172
+ var newTestSuitePath = (0, _utils.getTestPath)(test.parent);
173
+ var newTestFullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, test);
174
+ if (this.testPlan && !(0, _utils.isTestPresentInTestPlan)(newTestFullName, this.testPlan)) {
175
+ test.mode = "skip";
176
+ this.runContext.skippedTestsFullNamesByTestPlan.push(newTestFullName);
177
+ return;
203
178
  }
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);
179
+ _assertClassBrand(_Class_brand, this, _startScope).call(this);
180
+ var testUuid = this.runtime.startTest({
181
+ name: test.name,
182
+ fullName: newTestFullName,
183
+ start: (_test$startedAt = test.startedAt) !== null && _test$startedAt !== void 0 ? _test$startedAt : undefined,
184
+ labels: [(0, _reporter.getLanguageLabel)(), (0, _reporter.getFrameworkLabel)("jest"), (0, _reporter.getPackageLabel)(this.testPath), (0, _reporter.getHostLabel)(), (0, _reporter.getThreadLabel)(_nodeProcess.env.JEST_WORKER_ID), ...(0, _reporter.getEnvironmentLabels)(), ...(0, _reporter.getSuiteLabels)(newTestSuitePath)]
185
+ }, this.runContext.scopes);
186
+ this.runContext.executables.push(testUuid);
187
+ return testUuid;
188
+ }
189
+ function _stopTest(testUuid, duration) {
190
+ if (!testUuid) {
191
+ return;
221
192
  }
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)));
193
+ this.runtime.stopTest(testUuid, {
194
+ duration
195
+ });
196
+ this.runtime.writeTest(testUuid);
197
+ }
198
+ function _handleTestStart(test) {
199
+ var testUuid = _assertClassBrand(_Class_brand, this, _startTest).call(this, test);
200
+ if (!testUuid) {
201
+ return;
237
202
  }
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)));
203
+ this.runtime.updateTest(testUuid, result => {
204
+ result.stage = _allureJsCommons.Stage.RUNNING;
205
+ });
206
+ }
207
+ function _handleTestDone() {
208
+ _assertClassBrand(_Class_brand, this, _stopScope).call(this);
209
+ }
210
+ function _startScope() {
211
+ var scopeUuid = this.runtime.startScope();
212
+ this.runContext.scopes.push(scopeUuid);
213
+ }
214
+ function _stopScope() {
215
+ var scopeUuid = this.runContext.scopes.pop();
216
+ this.runtime.writeScope(scopeUuid);
217
+ }
218
+ function _handleTestPass(test) {
219
+ var _test$duration;
220
+ var testUuid = this.runContext.executables.pop();
221
+ if (!testUuid) {
222
+ return;
249
223
  }
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)));
224
+ this.runtime.updateTest(testUuid, result => {
225
+ result.stage = _allureJsCommons.Stage.FINISHED;
226
+ result.status = _allureJsCommons.Status.PASSED;
227
+ });
228
+ _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration = test.duration) !== null && _test$duration !== void 0 ? _test$duration : 0);
229
+ }
230
+ function _handleTestFail(test) {
231
+ var _test$duration2;
232
+ var testUuid = this.runContext.executables.pop();
233
+ if (!testUuid) {
234
+ return;
265
235
  }
266
- };
236
+
237
+ // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed
238
+ var [error] = test.errors;
239
+ var hasMultipleErrors = Array.isArray(error);
240
+ var firstError = hasMultipleErrors ? error[0] : error;
241
+ var details = (0, _sdk.getMessageAndTraceFromError)(firstError);
242
+ var status = (0, _sdk.getStatusFromError)(firstError);
243
+ this.runtime.updateTest(testUuid, result => {
244
+ result.stage = _allureJsCommons.Stage.FINISHED;
245
+ result.status = status;
246
+ result.statusDetails = _objectSpread({}, details);
247
+ });
248
+ _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration2 = test.duration) !== null && _test$duration2 !== void 0 ? _test$duration2 : 0);
249
+ }
250
+ function _handleTestSkip(test) {
251
+ var _test$duration3;
252
+ var newTestFullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, test);
253
+ if (this.runContext.skippedTestsFullNamesByTestPlan.includes(newTestFullName)) {
254
+ return;
255
+ }
256
+ var testUuid = this.runContext.executables.pop();
257
+ if (!testUuid) {
258
+ return;
259
+ }
260
+ this.runtime.updateTest(testUuid, result => {
261
+ result.stage = _allureJsCommons.Stage.PENDING;
262
+ result.status = _allureJsCommons.Status.SKIPPED;
263
+ });
264
+ _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration3 = test.duration) !== null && _test$duration3 !== void 0 ? _test$duration3 : 0);
265
+ }
266
+ function _handleTestTodo(test) {
267
+ var _test$duration4;
268
+ var testUuid = this.runContext.executables.pop();
269
+ if (!testUuid) {
270
+ return;
271
+ }
272
+ this.runtime.updateTest(testUuid, result => {
273
+ result.stage = _allureJsCommons.Stage.PENDING;
274
+ result.status = _allureJsCommons.Status.SKIPPED;
275
+ });
276
+ _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration4 = test.duration) !== null && _test$duration4 !== void 0 ? _test$duration4 : 0);
277
+ }
278
+ function _handleRunFinish() {
279
+ this.runtime.writeEnvironmentInfo();
280
+ this.runtime.writeCategoriesDefinitions();
281
+ }
267
282
  };
268
283
  var _default = exports.default = createJestEnvironment;
269
284
  module.exports = exports.default;
@@ -1 +1 @@
1
- {"version":3,"file":"environmentFactory.js","names":["_nodeOs","_interopRequireDefault","require","_nodePath","_nodeProcess","_allureJsCommons","_interopRequireWildcard","allure","_sdk","_reporter","_runtime","_AllureJestTestRuntime","_utils","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_objectWithoutProperties","_objectWithoutPropertiesLoose","indexOf","propertyIsEnumerable","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","ALLURE_HOST_NAME","ALLURE_THREAD_NAME","JEST_WORKER_ID","process","env","hostname","os","createJestEnvironment","Base","constructor","config","context","_config$projectConfig","Map","event","state","name","handleTestAdd","testName","test","concurrent","handleTestStart","handleTestTodo","handleTestPass","handleTestFail","handleTestSkip","handleTestDone","_ref","projectConfig","testEnvironmentOptions","resultsDir","testMode","restConfig","runtime","ReporterRuntime","writer","MessageWriter","FileSystemWriter","testPath","replace","globalConfig","rootDir","sep","testRuntime","AllureJestTestRuntime","global","setGlobalTestRuntime","setup","teardown","handleAllureRuntimeMessage","payload","testUuid","getTestUuid","currentTestName","parent","applyRuntimeMessages","message","getTestPath","currentTestId","getTestId","allureUuidsByTestIds","console","error","concat","undefined","currentDescribeBlock","newTestSuitesPath","newTestPath","newTestId","threadLabel","pid","toString","hostLabel","packageLabel","dirname","split","join","startTest","fullName","labels","LabelName","LANGUAGE","FRAMEWORK","PACKAGE","updateTest","result","THREAD","HOST","getSuitesLabels","stage","Stage","RUNNING","FINISHED","status","Status","PASSED","errors","hasMultipleErrors","Array","isArray","firstError","details","getMessageAndTraceFromError","getStatusFromError","statusDetails","PENDING","SKIPPED","stopTest","uuid","writeTest","delete","_default","exports","module"],"sources":["../../src/environmentFactory.ts"],"sourcesContent":["import type { EnvironmentContext, JestEnvironment } from \"@jest/environment\";\nimport type { Circus } from \"@jest/types\";\nimport os from \"node:os\";\nimport { dirname, sep } from \"node:path\";\nimport process from \"node:process\";\nimport * as allure from \"allure-js-commons\";\nimport { LabelName, Stage, Status } from \"allure-js-commons\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport { getMessageAndTraceFromError, getStatusFromError } from \"allure-js-commons/sdk\";\nimport { FileSystemWriter, MessageWriter, ReporterRuntime, getSuitesLabels } from \"allure-js-commons/sdk/reporter\";\nimport { setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport { AllureJestTestRuntime } from \"./AllureJestTestRuntime.js\";\nimport type { AllureJestConfig, AllureJestEnvironment } from \"./model.js\";\nimport { getTestId, getTestPath } from \"./utils.js\";\n\nconst { ALLURE_HOST_NAME, ALLURE_THREAD_NAME, JEST_WORKER_ID } = process.env;\nconst hostname = os.hostname();\n\nconst createJestEnvironment = <T extends typeof JestEnvironment>(Base: T): T => {\n // @ts-expect-error (ts(2545)) Incorrect assumption about a mixin class: https://github.com/microsoft/TypeScript/issues/37142\n return class extends Base {\n testPath: string;\n runtime: ReporterRuntime;\n allureUuidsByTestIds: Map<string, string> = new Map();\n\n constructor(config: AllureJestConfig, context: EnvironmentContext) {\n super(config, context);\n\n const {\n resultsDir = \"allure-results\",\n testMode = false,\n ...restConfig\n } = config?.projectConfig?.testEnvironmentOptions || {};\n\n this.runtime = new ReporterRuntime({\n ...restConfig,\n writer: testMode\n ? new MessageWriter()\n : new FileSystemWriter({\n resultsDir,\n }),\n });\n this.testPath = context.testPath.replace(config.globalConfig.rootDir, \"\").replace(sep, \"\");\n\n // @ts-ignore\n const testRuntime = new AllureJestTestRuntime(this as AllureJestEnvironment, this.global);\n\n // @ts-ignore\n this.global.allure = allure;\n\n setGlobalTestRuntime(testRuntime);\n }\n\n setup() {\n return super.setup();\n }\n\n teardown() {\n return super.teardown();\n }\n\n handleAllureRuntimeMessage(payload: { currentTestName: string; message: RuntimeMessage }) {\n const testUuid = this.getTestUuid({\n name: payload.currentTestName,\n // little hack because first element in the path will be always ommited\n parent: { name: \"ROOT_DESCRIBE_BLOCK\" },\n } as Circus.TestEntry)!;\n\n this.runtime.applyRuntimeMessages([payload.message], { testUuid });\n }\n\n private getTestUuid(test: Circus.TestEntry) {\n const testPath = getTestPath(test);\n const currentTestId = getTestId(testPath);\n const testUuid = this.allureUuidsByTestIds.get(currentTestId);\n\n if (!testUuid) {\n // eslint-disable-next-line no-console\n console.error(`Can't find \"${currentTestId}\" test while tried to start it!`);\n return undefined;\n }\n\n return testUuid;\n }\n\n handleTestEvent = (event: Circus.Event, state: Circus.State) => {\n switch (event.name) {\n case \"test_retry\":\n this.handleTestAdd({\n testName: event.test.name,\n concurrent: event.test.concurrent,\n state,\n });\n break;\n case \"add_test\":\n this.handleTestAdd({\n testName: event.testName,\n concurrent: event.concurrent,\n state,\n });\n break;\n case \"test_start\":\n this.handleTestStart(event.test);\n break;\n case \"test_todo\":\n this.handleTestTodo(event.test);\n break;\n case \"test_fn_success\":\n this.handleTestPass(event.test);\n break;\n case \"test_fn_failure\":\n this.handleTestFail(event.test);\n break;\n case \"test_skip\":\n this.handleTestSkip(event.test);\n break;\n case \"test_done\":\n this.handleTestDone(event.test);\n break;\n default:\n break;\n }\n };\n\n private handleTestAdd(payload: { testName: string; concurrent: boolean; state: Circus.State }) {\n const { testName, state } = payload;\n const { currentDescribeBlock } = state;\n const newTestSuitesPath = getTestPath(currentDescribeBlock);\n const newTestPath = newTestSuitesPath.concat(testName);\n const newTestId = getTestId(newTestPath);\n const threadLabel = ALLURE_THREAD_NAME || JEST_WORKER_ID || process.pid.toString();\n const hostLabel = ALLURE_HOST_NAME || hostname;\n const packageLabel = dirname(this.testPath).split(sep).join(\".\");\n const testUuid = this.runtime.startTest({\n name: testName,\n fullName: newTestId,\n labels: [\n {\n name: LabelName.LANGUAGE,\n value: \"javascript\",\n },\n {\n name: LabelName.FRAMEWORK,\n value: \"jest\",\n },\n {\n name: LabelName.PACKAGE,\n value: packageLabel,\n },\n ],\n });\n\n this.runtime.updateTest((result) => {\n if (threadLabel) {\n result.labels.push({ name: LabelName.THREAD, value: threadLabel });\n }\n\n if (hostLabel) {\n result.labels.push({ name: LabelName.HOST, value: hostLabel });\n }\n\n result.labels.push(...getSuitesLabels(newTestSuitesPath));\n }, testUuid);\n\n /**\n * If user have some tests with the same name, reporter will throw an error due the test with\n * the same name could be removed from the running tests, so better to throw an explicit error\n */\n if (this.allureUuidsByTestIds.has(newTestId)) {\n // eslint-disable-next-line no-console\n console.error(\n `Test \"${newTestId}\" has been already initialized! To continue with reporting, please rename the test.`,\n );\n return;\n }\n\n this.allureUuidsByTestIds.set(newTestId, testUuid as string);\n }\n\n private handleTestStart(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.RUNNING;\n }, testUuid);\n }\n\n private handleTestPass(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.PASSED;\n }, testUuid);\n }\n\n private handleTestFail(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed\n const [error] = test.errors;\n const hasMultipleErrors = Array.isArray(error);\n const firstError: Error = hasMultipleErrors ? error[0] : error;\n const details = getMessageAndTraceFromError(firstError);\n const status = getStatusFromError(firstError);\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.FINISHED;\n result.status = status;\n result.statusDetails = {\n ...details,\n };\n }, testUuid);\n }\n\n private handleTestSkip(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.PENDING;\n result.status = Status.SKIPPED;\n }, testUuid);\n this.runtime.stopTest({ uuid: testUuid });\n this.runtime.writeTest(testUuid);\n // TODO:\n this.allureUuidsByTestIds.delete(getTestId(getTestPath(test)));\n }\n\n private handleTestDone(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.stopTest({ uuid: testUuid });\n this.runtime.writeTest(testUuid);\n // TODO:\n this.allureUuidsByTestIds.delete(getTestId(getTestPath(test)));\n }\n\n private handleTestTodo(test: Circus.TestEntry) {\n const testUuid = this.getTestUuid(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest((result) => {\n result.stage = Stage.PENDING;\n result.status = Status.SKIPPED;\n }, testUuid);\n\n this.runtime.stopTest({ uuid: testUuid });\n this.runtime.writeTest(testUuid);\n // TODO:\n this.allureUuidsByTestIds.delete(getTestId(getTestPath(test)));\n }\n };\n};\n\nexport default createJestEnvironment;\n"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,gBAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAA4C,IAAAK,MAAA,GAAAF,gBAAA;AAG5C,IAAAG,IAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,sBAAA,GAAAT,OAAA;AAEA,IAAAU,MAAA,GAAAV,OAAA;AAAoD,IAAAW,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,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CAAC;MAChC;MACA,IAAI,CAACS,oBAAoB,CAACkD,MAAM,CAAC,IAAAnD,gBAAS,EAAC,IAAAF,kBAAW,EAACtC,IAAI,CAAC,CAAC,CAAC;IAChE;EACF,CAAC;AACH,CAAC;AAAC,IAAA4F,QAAA,GAAAC,OAAA,CAAA3J,OAAA,GAEakD,qBAAqB;AAAA0G,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA3J,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"environmentFactory.js","names":["_nodePath","require","_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","createJestEnvironment","Base","_Class_brand","WeakSet","constructor","config","context","executables","steps","scopes","skippedTestsFullNamesByTestPlan","event","name","_handleHookStart","hook","_handleHookPass","_handleHookFail","error","_handleSuiteStart","_handleSuiteEnd","_handleTestStart","test","_handleTestDone","_handleTestTodo","_handleTestPass","_handleTestFail","_handleTestSkip","_handleRunFinish","projectConfig","_ref","testEnvironmentOptions","resultsDir","restConfig","runtime","ReporterRuntime","writer","createDefaultWriter","testPath","replace","rootDir","sep","testPlan","parseTestPlan","testRuntime","AllureJestTestRuntime","global","setGlobalTestRuntime","setup","teardown","handleAllureRuntimeMessage","message","executableUuid","last","runContext","applyRuntimeMessages","_getTestFullName","newTestSuitePath","getTestPath","parent","newTestPath","concat","newTestId","getTestId","_startScope","_stopScope","shouldHookBeSkipped","scopeUuid","fixtureUuid","startFixture","type","pop","updateFixture","status","Status","PASSED","stage","Stage","FINISHED","stopFixture","BROKEN","getStatusFromError","statusDetails","trace","undefined","stack","_startTest","_test$startedAt","newTestFullName","isTestPresentInTestPlan","mode","testUuid","startTest","fullName","start","startedAt","labels","getLanguageLabel","getFrameworkLabel","getPackageLabel","getHostLabel","getThreadLabel","env","JEST_WORKER_ID","getEnvironmentLabels","getSuiteLabels","_stopTest","duration","stopTest","writeTest","updateTest","result","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 { sep } from \"node:path\";\nimport { env } from \"node:process\";\nimport * as allure from \"allure-js-commons\";\nimport { Stage, Status } from \"allure-js-commons\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport { getMessageAndTraceFromError, getStatusFromError } from \"allure-js-commons/sdk\";\nimport type { TestPlanV1 } from \"allure-js-commons/sdk\";\nimport {\n ReporterRuntime,\n createDefaultWriter,\n getEnvironmentLabels,\n getFrameworkLabel,\n getHostLabel,\n getLanguageLabel,\n getPackageLabel,\n getSuiteLabels,\n getThreadLabel,\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 createJestEnvironment = <T extends typeof JestEnvironment>(Base: T): T => {\n // @ts-expect-error (ts(2545)) Incorrect assumption about a mixin class: https://github.com/microsoft/TypeScript/issues/37142\n return class extends Base {\n testPath: string;\n testPlan?: TestPlanV1;\n runtime: ReporterRuntime;\n runContext: RunContext = {\n executables: [],\n steps: [],\n scopes: [],\n skippedTestsFullNamesByTestPlan: [],\n };\n\n // config is AllureJestConfig in Jest v28 or greater. In older versions\n // it's AllureJestProjectConfig. See https://github.com/jestjs/jest/pull/12461\n constructor(config: AllureJestConfig | AllureJestProjectConfig, context: EnvironmentContext) {\n super(config as JestEnvironmentConfig, context);\n\n const projectConfig = \"projectConfig\" in config ? config.projectConfig : config;\n const { resultsDir, ...restConfig } = projectConfig?.testEnvironmentOptions || {};\n\n this.runtime = new ReporterRuntime({\n ...restConfig,\n writer: createDefaultWriter({ resultsDir }),\n });\n this.testPath = context.testPath.replace(projectConfig.rootDir, \"\").replace(sep, \"\");\n this.testPlan = parseTestPlan();\n\n // @ts-ignore\n const testRuntime = new AllureJestTestRuntime(this as AllureJestEnvironment, this.global);\n\n // @ts-ignore\n this.global.allure = allure;\n\n setGlobalTestRuntime(testRuntime);\n }\n\n setup() {\n return super.setup();\n }\n\n teardown() {\n return super.teardown();\n }\n\n handleAllureRuntimeMessage(message: RuntimeMessage) {\n const executableUuid = last(this.runContext.executables);\n\n this.runtime.applyRuntimeMessages(executableUuid, [message]);\n }\n\n handleTestEvent = (event: Circus.Event) => {\n switch (event.name) {\n case \"hook_start\":\n this.#handleHookStart(event.hook);\n break;\n case \"hook_success\":\n this.#handleHookPass(event.hook);\n break;\n case \"hook_failure\":\n this.#handleHookFail(event.hook, event.error);\n break;\n case \"run_describe_start\":\n this.#handleSuiteStart();\n break;\n case \"run_describe_finish\":\n this.#handleSuiteEnd();\n break;\n case \"test_start\":\n this.#handleTestStart(event.test);\n break;\n case \"test_done\":\n this.#handleTestDone();\n break;\n case \"test_todo\":\n this.#handleTestTodo(event.test);\n break;\n case \"test_fn_success\":\n this.#handleTestPass(event.test);\n break;\n case \"test_fn_failure\":\n this.#handleTestFail(event.test);\n break;\n case \"test_skip\":\n this.#handleTestSkip(event.test);\n break;\n case \"run_finish\":\n this.#handleRunFinish();\n break;\n default:\n break;\n }\n };\n\n #getTestFullName(test: Circus.TestEntry) {\n const newTestSuitePath = getTestPath(test.parent);\n const newTestPath = newTestSuitePath.concat(test.name);\n const newTestId = getTestId(newTestPath);\n\n return `${this.testPath}#${newTestId}`;\n }\n\n #handleSuiteStart() {\n this.#startScope();\n }\n\n #handleSuiteEnd() {\n this.#stopScope();\n }\n\n #handleHookStart(hook: Circus.Hook) {\n if (shouldHookBeSkipped(hook)) {\n return;\n }\n\n const scopeUuid = last(this.runContext.scopes);\n const fixtureUuid = this.runtime.startFixture(scopeUuid, /after/i.test(hook.type) ? \"after\" : \"before\", {\n name: hook.type,\n })!;\n\n this.runContext.executables.push(fixtureUuid);\n }\n\n #handleHookPass(hook: Circus.Hook) {\n if (shouldHookBeSkipped(hook)) {\n return;\n }\n\n const fixtureUuid = this.runContext.executables.pop()!;\n\n this.runtime.updateFixture(fixtureUuid, (r) => {\n r.status = Status.PASSED;\n r.stage = Stage.FINISHED;\n });\n this.runtime.stopFixture(fixtureUuid);\n }\n\n #handleHookFail(hook: Circus.Hook, error: string | Circus.Exception) {\n if (shouldHookBeSkipped(hook)) {\n return;\n }\n\n const fixtureUuid = this.runContext.executables.pop()!;\n const status = typeof error === \"string\" ? Status.BROKEN : getStatusFromError(error as Error);\n\n this.runtime.updateFixture(fixtureUuid, (r) => {\n r.status = status;\n r.statusDetails = {\n message: typeof error === \"string\" ? error : error.message,\n trace: typeof error === \"string\" ? undefined : error.stack,\n };\n r.stage = Stage.FINISHED;\n });\n this.runtime.stopFixture(fixtureUuid);\n }\n\n #startTest(test: Circus.TestEntry) {\n const newTestSuitePath = getTestPath(test.parent);\n const newTestFullName = this.#getTestFullName(test);\n\n if (this.testPlan && !isTestPresentInTestPlan(newTestFullName, this.testPlan)) {\n test.mode = \"skip\";\n this.runContext.skippedTestsFullNamesByTestPlan.push(newTestFullName);\n return;\n }\n\n this.#startScope();\n const testUuid = this.runtime.startTest(\n {\n name: test.name,\n fullName: newTestFullName,\n start: test.startedAt ?? undefined,\n labels: [\n getLanguageLabel(),\n getFrameworkLabel(\"jest\"),\n getPackageLabel(this.testPath),\n getHostLabel(),\n getThreadLabel(env.JEST_WORKER_ID),\n ...getEnvironmentLabels(),\n ...getSuiteLabels(newTestSuitePath),\n ],\n },\n this.runContext.scopes,\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,SAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAC,uBAAA,CAAAH,OAAA;AAA4C,IAAAI,MAAA,GAAAF,gBAAA;AAG5C,IAAAG,IAAA,GAAAL,OAAA;AAEA,IAAAM,SAAA,GAAAN,OAAA;AAYA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,sBAAA,GAAAR,OAAA;AAEA,IAAAS,MAAA,GAAAT,OAAA;AAAwG,IAAAU,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,UA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+C,qBAAqB;AAAAoI,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAlL,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