allure-jest 3.0.1 → 3.0.3

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.
@@ -62,13 +62,10 @@ var createJestEnvironment = Base => {
62
62
  _assertClassBrand(_Class_brand, this, _handleSuiteEnd).call(this);
63
63
  break;
64
64
  case "test_start":
65
- _assertClassBrand(_Class_brand, this, _handleTestStart).call(this, event.test);
66
- break;
67
- case "test_done":
68
- _assertClassBrand(_Class_brand, this, _handleTestDone).call(this);
65
+ _assertClassBrand(_Class_brand, this, _handleTestScopeStart).call(this);
69
66
  break;
70
- case "test_todo":
71
- _assertClassBrand(_Class_brand, this, _handleTestTodo).call(this, event.test);
67
+ case "test_fn_start":
68
+ _assertClassBrand(_Class_brand, this, _handleTestStart).call(this, event.test);
72
69
  break;
73
70
  case "test_fn_success":
74
71
  _assertClassBrand(_Class_brand, this, _handleTestPass).call(this, event.test);
@@ -76,9 +73,15 @@ var createJestEnvironment = Base => {
76
73
  case "test_fn_failure":
77
74
  _assertClassBrand(_Class_brand, this, _handleTestFail).call(this, event.test);
78
75
  break;
76
+ case "test_done":
77
+ _assertClassBrand(_Class_brand, this, _handleTestScopeStop).call(this, event.test);
78
+ break;
79
79
  case "test_skip":
80
80
  _assertClassBrand(_Class_brand, this, _handleTestSkip).call(this, event.test);
81
81
  break;
82
+ case "test_todo":
83
+ _assertClassBrand(_Class_brand, this, _handleTestTodo).call(this, event.test);
84
+ break;
82
85
  case "run_finish":
83
86
  _assertClassBrand(_Class_brand, this, _handleRunFinish).call(this);
84
87
  break;
@@ -167,7 +170,7 @@ var createJestEnvironment = Base => {
167
170
  });
168
171
  this.runtime.stopFixture(fixtureUuid);
169
172
  }
170
- function _startTest(test) {
173
+ function _handleTestStart(test) {
171
174
  var _test$startedAt;
172
175
  var newTestSuitePath = (0, _utils.getTestPath)(test.parent);
173
176
  var newTestFullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, test);
@@ -176,35 +179,40 @@ var createJestEnvironment = Base => {
176
179
  this.runContext.skippedTestsFullNamesByTestPlan.push(newTestFullName);
177
180
  return;
178
181
  }
179
- _assertClassBrand(_Class_brand, this, _startScope).call(this);
180
182
  var testUuid = this.runtime.startTest({
181
183
  name: test.name,
182
184
  fullName: newTestFullName,
183
185
  start: (_test$startedAt = test.startedAt) !== null && _test$startedAt !== void 0 ? _test$startedAt : undefined,
186
+ stage: _allureJsCommons.Stage.RUNNING,
184
187
  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
188
  }, this.runContext.scopes);
186
189
  this.runContext.executables.push(testUuid);
187
190
  return testUuid;
188
191
  }
189
- function _stopTest(testUuid, duration) {
190
- if (!testUuid) {
191
- return;
192
- }
193
- this.runtime.stopTest(testUuid, {
194
- duration
195
- });
196
- this.runtime.writeTest(testUuid);
192
+ function _handleTestScopeStart() {
193
+ _assertClassBrand(_Class_brand, this, _startScope).call(this);
197
194
  }
198
- function _handleTestStart(test) {
199
- var testUuid = _assertClassBrand(_Class_brand, this, _startTest).call(this, test);
200
- if (!testUuid) {
201
- return;
195
+ function _handleTestScopeStop(test) {
196
+ var testUuid = this.runContext.executables.pop();
197
+ if (testUuid) {
198
+ var _tr, _tr2;
199
+ var {
200
+ details
201
+ } = _assertClassBrand(_Class_brand, this, _statusAndDetails).call(this, test.errors);
202
+ var tr;
203
+ this.runtime.updateTest(testUuid, result => {
204
+ tr = result;
205
+ });
206
+ // hook failure, finish as skipped
207
+ if (((_tr = tr) === null || _tr === void 0 ? void 0 : _tr.status) === undefined && ((_tr2 = tr) === null || _tr2 === void 0 ? void 0 : _tr2.stage) === _allureJsCommons.Stage.RUNNING) {
208
+ this.runtime.updateTest(testUuid, result => {
209
+ result.stage = _allureJsCommons.Stage.FINISHED;
210
+ result.status = _allureJsCommons.Status.SKIPPED;
211
+ result.statusDetails = _objectSpread(_objectSpread({}, result.statusDetails), details);
212
+ });
213
+ }
214
+ this.runtime.writeTest(testUuid);
202
215
  }
203
- this.runtime.updateTest(testUuid, result => {
204
- result.stage = _allureJsCommons.Stage.RUNNING;
205
- });
206
- }
207
- function _handleTestDone() {
208
216
  _assertClassBrand(_Class_brand, this, _stopScope).call(this);
209
217
  }
210
218
  function _startScope() {
@@ -213,72 +221,112 @@ var createJestEnvironment = Base => {
213
221
  }
214
222
  function _stopScope() {
215
223
  var scopeUuid = this.runContext.scopes.pop();
224
+ if (!scopeUuid) {
225
+ return;
226
+ }
216
227
  this.runtime.writeScope(scopeUuid);
217
228
  }
218
229
  function _handleTestPass(test) {
219
230
  var _test$duration;
220
- var testUuid = this.runContext.executables.pop();
231
+ var testUuid = _assertClassBrand(_Class_brand, this, _currentExecutable).call(this);
221
232
  if (!testUuid) {
222
233
  return;
223
234
  }
235
+ // @ts-ignore
236
+ var {
237
+ suppressedErrors = []
238
+ } = this.global.expect.getState();
239
+ var statusAndDetails = _assertClassBrand(_Class_brand, this, _statusAndDetails).call(this, suppressedErrors);
224
240
  this.runtime.updateTest(testUuid, result => {
225
241
  result.stage = _allureJsCommons.Stage.FINISHED;
226
- result.status = _allureJsCommons.Status.PASSED;
242
+ result.status = statusAndDetails.status;
243
+ result.statusDetails = _objectSpread(_objectSpread({}, result.statusDetails), statusAndDetails.details);
244
+ });
245
+ this.runtime.stopTest(testUuid, {
246
+ duration: (_test$duration = test.duration) !== null && _test$duration !== void 0 ? _test$duration : 0
227
247
  });
228
- _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration = test.duration) !== null && _test$duration !== void 0 ? _test$duration : 0);
229
248
  }
230
249
  function _handleTestFail(test) {
231
250
  var _test$duration2;
232
- var testUuid = this.runContext.executables.pop();
251
+ var testUuid = _assertClassBrand(_Class_brand, this, _currentExecutable).call(this);
233
252
  if (!testUuid) {
234
253
  return;
235
254
  }
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);
255
+ var {
256
+ status,
257
+ details
258
+ } = _assertClassBrand(_Class_brand, this, _statusAndDetails).call(this, test.errors);
243
259
  this.runtime.updateTest(testUuid, result => {
244
260
  result.stage = _allureJsCommons.Stage.FINISHED;
245
261
  result.status = status;
246
- result.statusDetails = _objectSpread({}, details);
262
+ result.statusDetails = _objectSpread(_objectSpread({}, result.statusDetails), details);
263
+ });
264
+ this.runtime.stopTest(testUuid, {
265
+ duration: (_test$duration2 = test.duration) !== null && _test$duration2 !== void 0 ? _test$duration2 : 0
247
266
  });
248
- _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration2 = test.duration) !== null && _test$duration2 !== void 0 ? _test$duration2 : 0);
249
267
  }
250
268
  function _handleTestSkip(test) {
251
- var _test$duration3;
252
269
  var newTestFullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, test);
253
270
  if (this.runContext.skippedTestsFullNamesByTestPlan.includes(newTestFullName)) {
254
271
  return;
255
272
  }
256
- var testUuid = this.runContext.executables.pop();
273
+
274
+ // noinspection JSPotentiallyInvalidUsageOfThis
275
+ var testUuid = _assertClassBrand(_Class_brand, this, _handleTestStart).call(this, test);
257
276
  if (!testUuid) {
258
277
  return;
259
278
  }
260
279
  this.runtime.updateTest(testUuid, result => {
261
- result.stage = _allureJsCommons.Stage.PENDING;
280
+ result.stage = _allureJsCommons.Stage.FINISHED;
262
281
  result.status = _allureJsCommons.Status.SKIPPED;
263
282
  });
264
- _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration3 = test.duration) !== null && _test$duration3 !== void 0 ? _test$duration3 : 0);
283
+ // noinspection JSPotentiallyInvalidUsageOfThis
284
+ _assertClassBrand(_Class_brand, this, _handleTestScopeStop).call(this, test);
265
285
  }
266
286
  function _handleTestTodo(test) {
267
- var _test$duration4;
268
- var testUuid = this.runContext.executables.pop();
287
+ // noinspection JSPotentiallyInvalidUsageOfThis
288
+ var testUuid = _assertClassBrand(_Class_brand, this, _handleTestStart).call(this, test);
269
289
  if (!testUuid) {
270
290
  return;
271
291
  }
272
292
  this.runtime.updateTest(testUuid, result => {
273
- result.stage = _allureJsCommons.Stage.PENDING;
293
+ result.stage = _allureJsCommons.Stage.FINISHED;
274
294
  result.status = _allureJsCommons.Status.SKIPPED;
295
+ result.statusDetails = {
296
+ message: "TODO"
297
+ };
275
298
  });
276
- _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration4 = test.duration) !== null && _test$duration4 !== void 0 ? _test$duration4 : 0);
299
+ // noinspection JSPotentiallyInvalidUsageOfThis
300
+ _assertClassBrand(_Class_brand, this, _handleTestScopeStop).call(this, test);
277
301
  }
278
302
  function _handleRunFinish() {
279
303
  this.runtime.writeEnvironmentInfo();
280
304
  this.runtime.writeCategoriesDefinitions();
281
305
  }
306
+ function _currentExecutable() {
307
+ if (this.runContext.executables.length === 0) {
308
+ return undefined;
309
+ }
310
+ return this.runContext.executables[this.runContext.executables.length - 1];
311
+ }
312
+ function _statusAndDetails(errors) {
313
+ if (errors.length === 0) {
314
+ return {
315
+ status: _allureJsCommons.Status.PASSED,
316
+ details: {}
317
+ };
318
+ }
319
+ // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed
320
+ var [error] = errors;
321
+ var hasMultipleErrors = Array.isArray(error);
322
+ var firstError = hasMultipleErrors ? error[0] : error;
323
+ var details = (0, _sdk.getMessageAndTraceFromError)(firstError);
324
+ var status = (0, _sdk.getStatusFromError)(firstError);
325
+ return {
326
+ status,
327
+ details
328
+ };
329
+ }
282
330
  };
283
331
  var _default = exports.default = createJestEnvironment;
284
332
  module.exports = exports.default;
@@ -1 +1 @@
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","relative","rootDir","testPlan","parseTestPlan","testRuntime","AllureJestTestRuntime","global","setGlobalTestRuntime","setup","teardown","handleAllureRuntimeMessage","message","executableUuid","last","runContext","applyRuntimeMessages","_getTestFullName","newTestSuitePath","getTestPath","parent","newTestPath","concat","newTestId","getTestId","getPosixPath","_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 { relative } 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 getPosixPath,\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 = relative(projectConfig.rootDir, context.testPath);\n this.testPlan = parseTestPlan();\n\n // @ts-ignore\n const testRuntime = new AllureJestTestRuntime(this as AllureJestEnvironment, this.global);\n\n // @ts-ignore\n this.global.allure = allure;\n\n setGlobalTestRuntime(testRuntime);\n }\n\n setup() {\n return super.setup();\n }\n\n teardown() {\n return super.teardown();\n }\n\n handleAllureRuntimeMessage(message: RuntimeMessage) {\n const executableUuid = last(this.runContext.executables);\n\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 `${getPosixPath(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;AAaA,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,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,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C;IACF/H,iBAAA,CAAAG,YAAA,MAAI,EAACuG,SAAQ,CAAC,CAAA7I,IAAA,CAAd,IAAI,EAAW8H,QAAQ,GAAAiC,eAAA,GAAEtG,IAAI,CAACqF,QAAQ,cAAAiB,eAAA,cAAAA,eAAA,GAAI,CAAC;EAC7C;EAAC,SAAApG,gBAEeF,IAAsB,EAAE;IAAA,IAAA0G,eAAA;IACtC,IAAMrC,QAAQ,GAAG,IAAI,CAACtC,UAAU,CAAC7C,WAAW,CAAC+D,GAAG,CAAC,CAAC;IAElD,IAAI,CAACoB,QAAQ,EAAE;MACb;IACF;IAEA,IAAI,CAACzD,OAAO,CAAC4E,UAAU,CAACnB,QAAQ,EAAGoB,MAAM,IAAK;MAC5CA,MAAM,CAACnC,KAAK,GAAGC,sBAAK,CAACiD,OAAO;MAC5Bf,MAAM,CAACtC,MAAM,GAAGC,uBAAM,CAACqD,OAAO;IAChC,CAAC,CAAC;IACF/H,iBAAA,CAAAG,YAAA,MAAI,EAACuG,SAAQ,CAAC,CAAA7I,IAAA,CAAd,IAAI,EAAW8H,QAAQ,GAAAqC,eAAA,GAAE1G,IAAI,CAACqF,QAAQ,cAAAqB,eAAA,cAAAA,eAAA,GAAI,CAAC;EAC7C;EAAC,SAAApG,iBAAA,EAEkB;IACjB,IAAI,CAACM,OAAO,CAAC+F,oBAAoB,CAAC,CAAC;IACnC,IAAI,CAAC/F,OAAO,CAACgG,0BAA0B,CAAC,CAAC;EAC3C;AAEJ,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAlL,OAAA,GAEa+C,qBAAqB;AAAAoI,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAlL,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","_handleTestScopeStart","_handleTestStart","test","_handleTestPass","_handleTestFail","_handleTestScopeStop","_handleTestSkip","_handleTestTodo","_handleRunFinish","projectConfig","_ref","testEnvironmentOptions","resultsDir","restConfig","runtime","ReporterRuntime","writer","createDefaultWriter","testPath","relative","rootDir","testPlan","parseTestPlan","testRuntime","AllureJestTestRuntime","global","setGlobalTestRuntime","setup","teardown","handleAllureRuntimeMessage","message","executableUuid","last","runContext","applyRuntimeMessages","_getTestFullName","newTestSuitePath","getTestPath","parent","newTestPath","concat","newTestId","getTestId","getPosixPath","_startScope","_stopScope","shouldHookBeSkipped","scopeUuid","fixtureUuid","startFixture","type","pop","updateFixture","status","Status","PASSED","stage","Stage","FINISHED","stopFixture","BROKEN","getStatusFromError","statusDetails","trace","undefined","stack","_test$startedAt","newTestFullName","isTestPresentInTestPlan","mode","testUuid","startTest","fullName","start","startedAt","RUNNING","labels","getLanguageLabel","getFrameworkLabel","getPackageLabel","getHostLabel","getThreadLabel","env","JEST_WORKER_ID","getEnvironmentLabels","getSuiteLabels","_tr","_tr2","details","_statusAndDetails","errors","tr","updateTest","result","SKIPPED","writeTest","startScope","writeScope","_test$duration","_currentExecutable","suppressedErrors","expect","getState","statusAndDetails","stopTest","duration","_test$duration2","includes","writeEnvironmentInfo","writeCategoriesDefinitions","hasMultipleErrors","Array","isArray","firstError","getMessageAndTraceFromError","_default","exports","module"],"sources":["../../src/environmentFactory.ts"],"sourcesContent":["import type { EnvironmentContext, JestEnvironment, JestEnvironmentConfig } from \"@jest/environment\";\nimport type { Circus } from \"@jest/types\";\nimport { relative } from \"node:path\";\nimport { env } from \"node:process\";\nimport * as allure from \"allure-js-commons\";\nimport { Stage, Status, type StatusDetails, type TestResult } 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 getPosixPath,\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 = relative(projectConfig.rootDir, context.testPath);\n this.testPlan = parseTestPlan();\n\n // @ts-ignore\n const testRuntime = new AllureJestTestRuntime(this as AllureJestEnvironment, this.global);\n\n // @ts-ignore\n this.global.allure = allure;\n\n setGlobalTestRuntime(testRuntime);\n }\n\n setup() {\n return super.setup();\n }\n\n teardown() {\n return super.teardown();\n }\n\n handleAllureRuntimeMessage(message: RuntimeMessage) {\n const executableUuid = last(this.runContext.executables);\n\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.#handleTestScopeStart();\n break;\n case \"test_fn_start\":\n this.#handleTestStart(event.test);\n break;\n case \"test_fn_success\":\n this.#handleTestPass(event.test);\n break;\n case \"test_fn_failure\":\n this.#handleTestFail(event.test);\n break;\n case \"test_done\":\n this.#handleTestScopeStop(event.test);\n break;\n case \"test_skip\":\n this.#handleTestSkip(event.test);\n break;\n case \"test_todo\":\n this.#handleTestTodo(event.test);\n break;\n case \"run_finish\":\n this.#handleRunFinish();\n break;\n default:\n break;\n }\n };\n\n #getTestFullName(test: Circus.TestEntry) {\n const newTestSuitePath = getTestPath(test.parent);\n const newTestPath = newTestSuitePath.concat(test.name);\n const newTestId = getTestId(newTestPath);\n\n return `${getPosixPath(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 #handleTestStart(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 testUuid = this.runtime.startTest(\n {\n name: test.name,\n fullName: newTestFullName,\n start: test.startedAt ?? undefined,\n stage: Stage.RUNNING,\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 #handleTestScopeStart() {\n this.#startScope();\n }\n\n #handleTestScopeStop(test: Circus.TestEntry) {\n const testUuid = this.runContext.executables.pop();\n\n if (testUuid) {\n const { details } = this.#statusAndDetails(test.errors);\n let tr: TestResult | undefined;\n this.runtime.updateTest(testUuid, (result) => {\n tr = result;\n });\n // hook failure, finish as skipped\n if (tr?.status === undefined && tr?.stage === Stage.RUNNING) {\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.SKIPPED;\n result.statusDetails = {\n ...result.statusDetails,\n ...details,\n };\n });\n }\n\n this.runtime.writeTest(testUuid);\n }\n\n this.#stopScope();\n }\n\n #startScope() {\n const scopeUuid = this.runtime.startScope();\n\n this.runContext.scopes.push(scopeUuid);\n }\n\n #stopScope() {\n const scopeUuid = this.runContext.scopes.pop();\n if (!scopeUuid) {\n return;\n }\n\n this.runtime.writeScope(scopeUuid);\n }\n\n #handleTestPass(test: Circus.TestEntry) {\n const testUuid = this.#currentExecutable();\n\n if (!testUuid) {\n return;\n }\n // @ts-ignore\n const { suppressedErrors = [] } = this.global.expect.getState();\n const statusAndDetails = this.#statusAndDetails(suppressedErrors as Circus.TestError[]);\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = statusAndDetails.status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusAndDetails.details,\n };\n });\n\n this.runtime.stopTest(testUuid, { duration: test.duration ?? 0 });\n }\n\n #handleTestFail(test: Circus.TestEntry) {\n const testUuid = this.#currentExecutable();\n\n if (!testUuid) {\n return;\n }\n\n const { status, details } = this.#statusAndDetails(test.errors);\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...details,\n };\n });\n this.runtime.stopTest(testUuid, { duration: test.duration ?? 0 });\n }\n\n #handleTestSkip(test: Circus.TestEntry) {\n const newTestFullName = this.#getTestFullName(test);\n\n if (this.runContext.skippedTestsFullNamesByTestPlan.includes(newTestFullName)) {\n return;\n }\n\n // noinspection JSPotentiallyInvalidUsageOfThis\n const testUuid = this.#handleTestStart(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.SKIPPED;\n });\n // noinspection JSPotentiallyInvalidUsageOfThis\n this.#handleTestScopeStop(test);\n }\n\n #handleTestTodo(test: Circus.TestEntry) {\n // noinspection JSPotentiallyInvalidUsageOfThis\n const testUuid = this.#handleTestStart(test);\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.SKIPPED;\n result.statusDetails = {\n message: \"TODO\",\n };\n });\n // noinspection JSPotentiallyInvalidUsageOfThis\n this.#handleTestScopeStop(test);\n }\n\n #handleRunFinish() {\n this.runtime.writeEnvironmentInfo();\n this.runtime.writeCategoriesDefinitions();\n }\n\n #currentExecutable() {\n if (this.runContext.executables.length === 0) {\n return undefined;\n }\n return this.runContext.executables[this.runContext.executables.length - 1];\n }\n\n #statusAndDetails(errors: Circus.TestError[]): { status: Status; details: Partial<StatusDetails> } {\n if (errors.length === 0) {\n return {\n status: Status.PASSED,\n details: {},\n };\n }\n // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed\n const [error] = errors;\n const hasMultipleErrors = Array.isArray(error);\n const firstError: Error = hasMultipleErrors ? error[0] : error;\n const details = getMessageAndTraceFromError(firstError);\n const status = getStatusFromError(firstError);\n return { status, details };\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;AAaA,IAAAO,QAAA,GAAAP,OAAA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B,IAAI,IAAI,CAAClE,UAAU,CAAC9C,WAAW,CAAC9B,MAAM,KAAK,CAAC,EAAE;MAC5C,OAAO2G,SAAS;IAClB;IACA,OAAO,IAAI,CAAC/B,UAAU,CAAC9C,WAAW,CAAC,IAAI,CAAC8C,UAAU,CAAC9C,WAAW,CAAC9B,MAAM,GAAG,CAAC,CAAC;EAC5E;EAAC,SAAAoI,kBAEiBC,MAA0B,EAAuD;IACjG,IAAIA,MAAM,CAACrI,MAAM,KAAK,CAAC,EAAE;MACvB,OAAO;QACLgG,MAAM,EAAEC,uBAAM,CAACC,MAAM;QACrBiC,OAAO,EAAE,CAAC;MACZ,CAAC;IACH;IACA;IACA,IAAM,CAAC3F,KAAK,CAAC,GAAG6F,MAAM;IACtB,IAAMoB,iBAAiB,GAAGC,KAAK,CAACC,OAAO,CAACnH,KAAK,CAAC;IAC9C,IAAMoH,UAAiB,GAAGH,iBAAiB,GAAGjH,KAAK,CAAC,CAAC,CAAC,GAAGA,KAAK;IAC9D,IAAM2F,OAAO,GAAG,IAAA0B,gCAA2B,EAACD,UAAU,CAAC;IACvD,IAAM5D,MAAM,GAAG,IAAAQ,uBAAkB,EAACoD,UAAU,CAAC;IAC7C,OAAO;MAAE5D,MAAM;MAAEmC;IAAQ,CAAC;EAC5B;AAEJ,CAAC;AAAC,IAAA2B,QAAA,GAAAC,OAAA,CAAAvL,OAAA,GAEa+C,qBAAqB;AAAAyI,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAvL,OAAA","ignoreList":[]}
@@ -54,13 +54,10 @@ var createJestEnvironment = Base => {
54
54
  _assertClassBrand(_Class_brand, this, _handleSuiteEnd).call(this);
55
55
  break;
56
56
  case "test_start":
57
- _assertClassBrand(_Class_brand, this, _handleTestStart).call(this, event.test);
58
- break;
59
- case "test_done":
60
- _assertClassBrand(_Class_brand, this, _handleTestDone).call(this);
57
+ _assertClassBrand(_Class_brand, this, _handleTestScopeStart).call(this);
61
58
  break;
62
- case "test_todo":
63
- _assertClassBrand(_Class_brand, this, _handleTestTodo).call(this, event.test);
59
+ case "test_fn_start":
60
+ _assertClassBrand(_Class_brand, this, _handleTestStart).call(this, event.test);
64
61
  break;
65
62
  case "test_fn_success":
66
63
  _assertClassBrand(_Class_brand, this, _handleTestPass).call(this, event.test);
@@ -68,9 +65,15 @@ var createJestEnvironment = Base => {
68
65
  case "test_fn_failure":
69
66
  _assertClassBrand(_Class_brand, this, _handleTestFail).call(this, event.test);
70
67
  break;
68
+ case "test_done":
69
+ _assertClassBrand(_Class_brand, this, _handleTestScopeStop).call(this, event.test);
70
+ break;
71
71
  case "test_skip":
72
72
  _assertClassBrand(_Class_brand, this, _handleTestSkip).call(this, event.test);
73
73
  break;
74
+ case "test_todo":
75
+ _assertClassBrand(_Class_brand, this, _handleTestTodo).call(this, event.test);
76
+ break;
74
77
  case "run_finish":
75
78
  _assertClassBrand(_Class_brand, this, _handleRunFinish).call(this);
76
79
  break;
@@ -159,7 +162,7 @@ var createJestEnvironment = Base => {
159
162
  });
160
163
  this.runtime.stopFixture(fixtureUuid);
161
164
  }
162
- function _startTest(test) {
165
+ function _handleTestStart(test) {
163
166
  var _test$startedAt;
164
167
  var newTestSuitePath = getTestPath(test.parent);
165
168
  var newTestFullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, test);
@@ -168,35 +171,40 @@ var createJestEnvironment = Base => {
168
171
  this.runContext.skippedTestsFullNamesByTestPlan.push(newTestFullName);
169
172
  return;
170
173
  }
171
- _assertClassBrand(_Class_brand, this, _startScope).call(this);
172
174
  var testUuid = this.runtime.startTest({
173
175
  name: test.name,
174
176
  fullName: newTestFullName,
175
177
  start: (_test$startedAt = test.startedAt) !== null && _test$startedAt !== void 0 ? _test$startedAt : undefined,
178
+ stage: Stage.RUNNING,
176
179
  labels: [getLanguageLabel(), getFrameworkLabel("jest"), getPackageLabel(this.testPath), getHostLabel(), getThreadLabel(env.JEST_WORKER_ID), ...getEnvironmentLabels(), ...getSuiteLabels(newTestSuitePath)]
177
180
  }, this.runContext.scopes);
178
181
  this.runContext.executables.push(testUuid);
179
182
  return testUuid;
180
183
  }
181
- function _stopTest(testUuid, duration) {
182
- if (!testUuid) {
183
- return;
184
- }
185
- this.runtime.stopTest(testUuid, {
186
- duration
187
- });
188
- this.runtime.writeTest(testUuid);
184
+ function _handleTestScopeStart() {
185
+ _assertClassBrand(_Class_brand, this, _startScope).call(this);
189
186
  }
190
- function _handleTestStart(test) {
191
- var testUuid = _assertClassBrand(_Class_brand, this, _startTest).call(this, test);
192
- if (!testUuid) {
193
- return;
187
+ function _handleTestScopeStop(test) {
188
+ var testUuid = this.runContext.executables.pop();
189
+ if (testUuid) {
190
+ var _tr, _tr2;
191
+ var {
192
+ details
193
+ } = _assertClassBrand(_Class_brand, this, _statusAndDetails).call(this, test.errors);
194
+ var tr;
195
+ this.runtime.updateTest(testUuid, result => {
196
+ tr = result;
197
+ });
198
+ // hook failure, finish as skipped
199
+ if (((_tr = tr) === null || _tr === void 0 ? void 0 : _tr.status) === undefined && ((_tr2 = tr) === null || _tr2 === void 0 ? void 0 : _tr2.stage) === Stage.RUNNING) {
200
+ this.runtime.updateTest(testUuid, result => {
201
+ result.stage = Stage.FINISHED;
202
+ result.status = Status.SKIPPED;
203
+ result.statusDetails = _objectSpread(_objectSpread({}, result.statusDetails), details);
204
+ });
205
+ }
206
+ this.runtime.writeTest(testUuid);
194
207
  }
195
- this.runtime.updateTest(testUuid, result => {
196
- result.stage = Stage.RUNNING;
197
- });
198
- }
199
- function _handleTestDone() {
200
208
  _assertClassBrand(_Class_brand, this, _stopScope).call(this);
201
209
  }
202
210
  function _startScope() {
@@ -205,72 +213,112 @@ var createJestEnvironment = Base => {
205
213
  }
206
214
  function _stopScope() {
207
215
  var scopeUuid = this.runContext.scopes.pop();
216
+ if (!scopeUuid) {
217
+ return;
218
+ }
208
219
  this.runtime.writeScope(scopeUuid);
209
220
  }
210
221
  function _handleTestPass(test) {
211
222
  var _test$duration;
212
- var testUuid = this.runContext.executables.pop();
223
+ var testUuid = _assertClassBrand(_Class_brand, this, _currentExecutable).call(this);
213
224
  if (!testUuid) {
214
225
  return;
215
226
  }
227
+ // @ts-ignore
228
+ var {
229
+ suppressedErrors = []
230
+ } = this.global.expect.getState();
231
+ var statusAndDetails = _assertClassBrand(_Class_brand, this, _statusAndDetails).call(this, suppressedErrors);
216
232
  this.runtime.updateTest(testUuid, result => {
217
233
  result.stage = Stage.FINISHED;
218
- result.status = Status.PASSED;
234
+ result.status = statusAndDetails.status;
235
+ result.statusDetails = _objectSpread(_objectSpread({}, result.statusDetails), statusAndDetails.details);
236
+ });
237
+ this.runtime.stopTest(testUuid, {
238
+ duration: (_test$duration = test.duration) !== null && _test$duration !== void 0 ? _test$duration : 0
219
239
  });
220
- _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration = test.duration) !== null && _test$duration !== void 0 ? _test$duration : 0);
221
240
  }
222
241
  function _handleTestFail(test) {
223
242
  var _test$duration2;
224
- var testUuid = this.runContext.executables.pop();
243
+ var testUuid = _assertClassBrand(_Class_brand, this, _currentExecutable).call(this);
225
244
  if (!testUuid) {
226
245
  return;
227
246
  }
228
-
229
- // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed
230
- var [error] = test.errors;
231
- var hasMultipleErrors = Array.isArray(error);
232
- var firstError = hasMultipleErrors ? error[0] : error;
233
- var details = getMessageAndTraceFromError(firstError);
234
- var status = getStatusFromError(firstError);
247
+ var {
248
+ status,
249
+ details
250
+ } = _assertClassBrand(_Class_brand, this, _statusAndDetails).call(this, test.errors);
235
251
  this.runtime.updateTest(testUuid, result => {
236
252
  result.stage = Stage.FINISHED;
237
253
  result.status = status;
238
- result.statusDetails = _objectSpread({}, details);
254
+ result.statusDetails = _objectSpread(_objectSpread({}, result.statusDetails), details);
255
+ });
256
+ this.runtime.stopTest(testUuid, {
257
+ duration: (_test$duration2 = test.duration) !== null && _test$duration2 !== void 0 ? _test$duration2 : 0
239
258
  });
240
- _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration2 = test.duration) !== null && _test$duration2 !== void 0 ? _test$duration2 : 0);
241
259
  }
242
260
  function _handleTestSkip(test) {
243
- var _test$duration3;
244
261
  var newTestFullName = _assertClassBrand(_Class_brand, this, _getTestFullName).call(this, test);
245
262
  if (this.runContext.skippedTestsFullNamesByTestPlan.includes(newTestFullName)) {
246
263
  return;
247
264
  }
248
- var testUuid = this.runContext.executables.pop();
265
+
266
+ // noinspection JSPotentiallyInvalidUsageOfThis
267
+ var testUuid = _assertClassBrand(_Class_brand, this, _handleTestStart).call(this, test);
249
268
  if (!testUuid) {
250
269
  return;
251
270
  }
252
271
  this.runtime.updateTest(testUuid, result => {
253
- result.stage = Stage.PENDING;
272
+ result.stage = Stage.FINISHED;
254
273
  result.status = Status.SKIPPED;
255
274
  });
256
- _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration3 = test.duration) !== null && _test$duration3 !== void 0 ? _test$duration3 : 0);
275
+ // noinspection JSPotentiallyInvalidUsageOfThis
276
+ _assertClassBrand(_Class_brand, this, _handleTestScopeStop).call(this, test);
257
277
  }
258
278
  function _handleTestTodo(test) {
259
- var _test$duration4;
260
- var testUuid = this.runContext.executables.pop();
279
+ // noinspection JSPotentiallyInvalidUsageOfThis
280
+ var testUuid = _assertClassBrand(_Class_brand, this, _handleTestStart).call(this, test);
261
281
  if (!testUuid) {
262
282
  return;
263
283
  }
264
284
  this.runtime.updateTest(testUuid, result => {
265
- result.stage = Stage.PENDING;
285
+ result.stage = Stage.FINISHED;
266
286
  result.status = Status.SKIPPED;
287
+ result.statusDetails = {
288
+ message: "TODO"
289
+ };
267
290
  });
268
- _assertClassBrand(_Class_brand, this, _stopTest).call(this, testUuid, (_test$duration4 = test.duration) !== null && _test$duration4 !== void 0 ? _test$duration4 : 0);
291
+ // noinspection JSPotentiallyInvalidUsageOfThis
292
+ _assertClassBrand(_Class_brand, this, _handleTestScopeStop).call(this, test);
269
293
  }
270
294
  function _handleRunFinish() {
271
295
  this.runtime.writeEnvironmentInfo();
272
296
  this.runtime.writeCategoriesDefinitions();
273
297
  }
298
+ function _currentExecutable() {
299
+ if (this.runContext.executables.length === 0) {
300
+ return undefined;
301
+ }
302
+ return this.runContext.executables[this.runContext.executables.length - 1];
303
+ }
304
+ function _statusAndDetails(errors) {
305
+ if (errors.length === 0) {
306
+ return {
307
+ status: Status.PASSED,
308
+ details: {}
309
+ };
310
+ }
311
+ // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed
312
+ var [error] = errors;
313
+ var hasMultipleErrors = Array.isArray(error);
314
+ var firstError = hasMultipleErrors ? error[0] : error;
315
+ var details = getMessageAndTraceFromError(firstError);
316
+ var status = getStatusFromError(firstError);
317
+ return {
318
+ status,
319
+ details
320
+ };
321
+ }
274
322
  };
275
323
  export default createJestEnvironment;
276
324
  //# sourceMappingURL=environmentFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"environmentFactory.js","names":["relative","env","allure","Stage","Status","getMessageAndTraceFromError","getStatusFromError","ReporterRuntime","createDefaultWriter","getEnvironmentLabels","getFrameworkLabel","getHostLabel","getLanguageLabel","getPackageLabel","getPosixPath","getSuiteLabels","getThreadLabel","parseTestPlan","setGlobalTestRuntime","AllureJestTestRuntime","getTestId","getTestPath","isTestPresentInTestPlan","last","shouldHookBeSkipped","createJestEnvironment","Base","_Class_brand","WeakSet","constructor","config","context","_classPrivateMethodInitSpec","_defineProperty","executables","steps","scopes","skippedTestsFullNamesByTestPlan","event","name","_assertClassBrand","_handleHookStart","call","hook","_handleHookPass","_handleHookFail","error","_handleSuiteStart","_handleSuiteEnd","_handleTestStart","test","_handleTestDone","_handleTestTodo","_handleTestPass","_handleTestFail","_handleTestSkip","_handleRunFinish","projectConfig","_ref","testEnvironmentOptions","resultsDir","restConfig","_objectWithoutProperties","_excluded","runtime","_objectSpread","writer","testPath","rootDir","testPlan","testRuntime","global","setup","teardown","handleAllureRuntimeMessage","message","executableUuid","runContext","applyRuntimeMessages","_getTestFullName","newTestSuitePath","parent","newTestPath","concat","newTestId","_startScope","_stopScope","scopeUuid","fixtureUuid","startFixture","type","push","pop","updateFixture","r","status","PASSED","stage","FINISHED","stopFixture","BROKEN","statusDetails","trace","undefined","stack","_startTest","_test$startedAt","newTestFullName","mode","testUuid","startTest","fullName","start","startedAt","labels","JEST_WORKER_ID","_stopTest","duration","stopTest","writeTest","updateTest","result","RUNNING","startScope","writeScope","_test$duration","_test$duration2","errors","hasMultipleErrors","Array","isArray","firstError","details","_test$duration3","includes","PENDING","SKIPPED","_test$duration4","writeEnvironmentInfo","writeCategoriesDefinitions"],"sources":["../../src/environmentFactory.ts"],"sourcesContent":["import type { EnvironmentContext, JestEnvironment, JestEnvironmentConfig } from \"@jest/environment\";\nimport type { Circus } from \"@jest/types\";\nimport { relative } 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 getPosixPath,\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 = relative(projectConfig.rootDir, context.testPath);\n this.testPlan = parseTestPlan();\n\n // @ts-ignore\n const testRuntime = new AllureJestTestRuntime(this as AllureJestEnvironment, this.global);\n\n // @ts-ignore\n this.global.allure = allure;\n\n setGlobalTestRuntime(testRuntime);\n }\n\n setup() {\n return super.setup();\n }\n\n teardown() {\n return super.teardown();\n }\n\n handleAllureRuntimeMessage(message: RuntimeMessage) {\n const executableUuid = last(this.runContext.executables);\n\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 `${getPosixPath(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,SAASA,QAAQ,QAAQ,WAAW;AACpC,SAASC,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,MAAM,MAAM,mBAAmB;AAC3C,SAASC,KAAK,EAAEC,MAAM,QAAQ,mBAAmB;AAEjD,SAASC,2BAA2B,EAAEC,kBAAkB,QAAQ,uBAAuB;AAEvF,SACEC,eAAe,EACfC,mBAAmB,EACnBC,oBAAoB,EACpBC,iBAAiB,EACjBC,YAAY,EACZC,gBAAgB,EAChBC,eAAe,EACfC,YAAY,EACZC,cAAc,EACdC,cAAc,EACdC,aAAa,QACR,gCAAgC;AACvC,SAASC,oBAAoB,QAAQ,+BAA+B;AACpE,SAASC,qBAAqB,QAAQ,4BAA4B;AAElE,SAASC,SAAS,EAAEC,WAAW,EAAEC,uBAAuB,EAAEC,IAAI,EAAEC,mBAAmB,QAAQ,YAAY;AAEvG,IAAMC,qBAAqB,GAAsCC,IAAO,IAAQ;EAAA,IAAAC,YAAA;EAC9E;EACA,OAAAA,YAAA,oBAAAC,OAAA,IAAO,cAAcF,IAAI,CAAC;IAWxB;IACA;IACAG,WAAW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AAQ,cAAAgB,eAAA,cAAAA,eAAA,GAAI,CAAC;EAC7C;EAAC,SAAAjF,gBAEeF,IAAsB,EAAE;IAAA,IAAAuF,eAAA;IACtC,IAAM5B,QAAQ,GAAG,IAAI,CAAChC,UAAU,CAAC3C,WAAW,CAAC0D,GAAG,CAAC,CAAC;IAElD,IAAI,CAACiB,QAAQ,EAAE;MACb;IACF;IAEA,IAAI,CAAC7C,OAAO,CAACwD,UAAU,CAACX,QAAQ,EAAGY,MAAM,IAAK;MAC5CA,MAAM,CAACxB,KAAK,GAAG9F,KAAK,CAACoI,OAAO;MAC5Bd,MAAM,CAAC1B,MAAM,GAAG3F,MAAM,CAACoI,OAAO;IAChC,CAAC,CAAC;IACFhG,iBAAA,CAAAb,YAAA,MAAI,EAACyF,SAAQ,CAAC,CAAA1E,IAAA,CAAd,IAAI,EAAWmE,QAAQ,GAAA4B,eAAA,GAAEvF,IAAI,CAACmE,QAAQ,cAAAoB,eAAA,cAAAA,eAAA,GAAI,CAAC;EAC7C;EAAC,SAAAjF,iBAAA,EAEkB;IACjB,IAAI,CAACQ,OAAO,CAAC0E,oBAAoB,CAAC,CAAC;IACnC,IAAI,CAAC1E,OAAO,CAAC2E,0BAA0B,CAAC,CAAC;EAC3C;AAEJ,CAAC;AAED,eAAelH,qBAAqB","ignoreList":[]}
1
+ {"version":3,"file":"environmentFactory.js","names":["relative","env","allure","Stage","Status","getMessageAndTraceFromError","getStatusFromError","ReporterRuntime","createDefaultWriter","getEnvironmentLabels","getFrameworkLabel","getHostLabel","getLanguageLabel","getPackageLabel","getPosixPath","getSuiteLabels","getThreadLabel","parseTestPlan","setGlobalTestRuntime","AllureJestTestRuntime","getTestId","getTestPath","isTestPresentInTestPlan","last","shouldHookBeSkipped","createJestEnvironment","Base","_Class_brand","WeakSet","constructor","config","context","_classPrivateMethodInitSpec","_defineProperty","executables","steps","scopes","skippedTestsFullNamesByTestPlan","event","name","_assertClassBrand","_handleHookStart","call","hook","_handleHookPass","_handleHookFail","error","_handleSuiteStart","_handleSuiteEnd","_handleTestScopeStart","_handleTestStart","test","_handleTestPass","_handleTestFail","_handleTestScopeStop","_handleTestSkip","_handleTestTodo","_handleRunFinish","projectConfig","_ref","testEnvironmentOptions","resultsDir","restConfig","_objectWithoutProperties","_excluded","runtime","_objectSpread","writer","testPath","rootDir","testPlan","testRuntime","global","setup","teardown","handleAllureRuntimeMessage","message","executableUuid","runContext","applyRuntimeMessages","_getTestFullName","newTestSuitePath","parent","newTestPath","concat","newTestId","_startScope","_stopScope","scopeUuid","fixtureUuid","startFixture","type","push","pop","updateFixture","r","status","PASSED","stage","FINISHED","stopFixture","BROKEN","statusDetails","trace","undefined","stack","_test$startedAt","newTestFullName","mode","testUuid","startTest","fullName","start","startedAt","RUNNING","labels","JEST_WORKER_ID","_tr","_tr2","details","_statusAndDetails","errors","tr","updateTest","result","SKIPPED","writeTest","startScope","writeScope","_test$duration","_currentExecutable","suppressedErrors","expect","getState","statusAndDetails","stopTest","duration","_test$duration2","includes","writeEnvironmentInfo","writeCategoriesDefinitions","length","hasMultipleErrors","Array","isArray","firstError"],"sources":["../../src/environmentFactory.ts"],"sourcesContent":["import type { EnvironmentContext, JestEnvironment, JestEnvironmentConfig } from \"@jest/environment\";\nimport type { Circus } from \"@jest/types\";\nimport { relative } from \"node:path\";\nimport { env } from \"node:process\";\nimport * as allure from \"allure-js-commons\";\nimport { Stage, Status, type StatusDetails, type TestResult } 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 getPosixPath,\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 = relative(projectConfig.rootDir, context.testPath);\n this.testPlan = parseTestPlan();\n\n // @ts-ignore\n const testRuntime = new AllureJestTestRuntime(this as AllureJestEnvironment, this.global);\n\n // @ts-ignore\n this.global.allure = allure;\n\n setGlobalTestRuntime(testRuntime);\n }\n\n setup() {\n return super.setup();\n }\n\n teardown() {\n return super.teardown();\n }\n\n handleAllureRuntimeMessage(message: RuntimeMessage) {\n const executableUuid = last(this.runContext.executables);\n\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.#handleTestScopeStart();\n break;\n case \"test_fn_start\":\n this.#handleTestStart(event.test);\n break;\n case \"test_fn_success\":\n this.#handleTestPass(event.test);\n break;\n case \"test_fn_failure\":\n this.#handleTestFail(event.test);\n break;\n case \"test_done\":\n this.#handleTestScopeStop(event.test);\n break;\n case \"test_skip\":\n this.#handleTestSkip(event.test);\n break;\n case \"test_todo\":\n this.#handleTestTodo(event.test);\n break;\n case \"run_finish\":\n this.#handleRunFinish();\n break;\n default:\n break;\n }\n };\n\n #getTestFullName(test: Circus.TestEntry) {\n const newTestSuitePath = getTestPath(test.parent);\n const newTestPath = newTestSuitePath.concat(test.name);\n const newTestId = getTestId(newTestPath);\n\n return `${getPosixPath(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 #handleTestStart(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 testUuid = this.runtime.startTest(\n {\n name: test.name,\n fullName: newTestFullName,\n start: test.startedAt ?? undefined,\n stage: Stage.RUNNING,\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 #handleTestScopeStart() {\n this.#startScope();\n }\n\n #handleTestScopeStop(test: Circus.TestEntry) {\n const testUuid = this.runContext.executables.pop();\n\n if (testUuid) {\n const { details } = this.#statusAndDetails(test.errors);\n let tr: TestResult | undefined;\n this.runtime.updateTest(testUuid, (result) => {\n tr = result;\n });\n // hook failure, finish as skipped\n if (tr?.status === undefined && tr?.stage === Stage.RUNNING) {\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.SKIPPED;\n result.statusDetails = {\n ...result.statusDetails,\n ...details,\n };\n });\n }\n\n this.runtime.writeTest(testUuid);\n }\n\n this.#stopScope();\n }\n\n #startScope() {\n const scopeUuid = this.runtime.startScope();\n\n this.runContext.scopes.push(scopeUuid);\n }\n\n #stopScope() {\n const scopeUuid = this.runContext.scopes.pop();\n if (!scopeUuid) {\n return;\n }\n\n this.runtime.writeScope(scopeUuid);\n }\n\n #handleTestPass(test: Circus.TestEntry) {\n const testUuid = this.#currentExecutable();\n\n if (!testUuid) {\n return;\n }\n // @ts-ignore\n const { suppressedErrors = [] } = this.global.expect.getState();\n const statusAndDetails = this.#statusAndDetails(suppressedErrors as Circus.TestError[]);\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = statusAndDetails.status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusAndDetails.details,\n };\n });\n\n this.runtime.stopTest(testUuid, { duration: test.duration ?? 0 });\n }\n\n #handleTestFail(test: Circus.TestEntry) {\n const testUuid = this.#currentExecutable();\n\n if (!testUuid) {\n return;\n }\n\n const { status, details } = this.#statusAndDetails(test.errors);\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...details,\n };\n });\n this.runtime.stopTest(testUuid, { duration: test.duration ?? 0 });\n }\n\n #handleTestSkip(test: Circus.TestEntry) {\n const newTestFullName = this.#getTestFullName(test);\n\n if (this.runContext.skippedTestsFullNamesByTestPlan.includes(newTestFullName)) {\n return;\n }\n\n // noinspection JSPotentiallyInvalidUsageOfThis\n const testUuid = this.#handleTestStart(test);\n\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.SKIPPED;\n });\n // noinspection JSPotentiallyInvalidUsageOfThis\n this.#handleTestScopeStop(test);\n }\n\n #handleTestTodo(test: Circus.TestEntry) {\n // noinspection JSPotentiallyInvalidUsageOfThis\n const testUuid = this.#handleTestStart(test);\n if (!testUuid) {\n return;\n }\n\n this.runtime.updateTest(testUuid, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.SKIPPED;\n result.statusDetails = {\n message: \"TODO\",\n };\n });\n // noinspection JSPotentiallyInvalidUsageOfThis\n this.#handleTestScopeStop(test);\n }\n\n #handleRunFinish() {\n this.runtime.writeEnvironmentInfo();\n this.runtime.writeCategoriesDefinitions();\n }\n\n #currentExecutable() {\n if (this.runContext.executables.length === 0) {\n return undefined;\n }\n return this.runContext.executables[this.runContext.executables.length - 1];\n }\n\n #statusAndDetails(errors: Circus.TestError[]): { status: Status; details: Partial<StatusDetails> } {\n if (errors.length === 0) {\n return {\n status: Status.PASSED,\n details: {},\n };\n }\n // jest collects all errors, but we need to report the first one because it's a reason why the test has been failed\n const [error] = errors;\n const hasMultipleErrors = Array.isArray(error);\n const firstError: Error = hasMultipleErrors ? error[0] : error;\n const details = getMessageAndTraceFromError(firstError);\n const status = getStatusFromError(firstError);\n return { status, details };\n }\n };\n};\n\nexport default createJestEnvironment;\n"],"mappings":";;;;;;;;;;;AAEA,SAASA,QAAQ,QAAQ,WAAW;AACpC,SAASC,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,MAAM,MAAM,mBAAmB;AAC3C,SAASC,KAAK,EAAEC,MAAM,QAA6C,mBAAmB;AAEtF,SAASC,2BAA2B,EAAEC,kBAAkB,QAAQ,uBAAuB;AAEvF,SACEC,eAAe,EACfC,mBAAmB,EACnBC,oBAAoB,EACpBC,iBAAiB,EACjBC,YAAY,EACZC,gBAAgB,EAChBC,eAAe,EACfC,YAAY,EACZC,cAAc,EACdC,cAAc,EACdC,aAAa,QACR,gCAAgC;AACvC,SAASC,oBAAoB,QAAQ,+BAA+B;AACpE,SAASC,qBAAqB,QAAQ,4BAA4B;AAElE,SAASC,SAAS,EAAEC,WAAW,EAAEC,uBAAuB,EAAEC,IAAI,EAAEC,mBAAmB,QAAQ,YAAY;AAEvG,IAAMC,qBAAqB,GAAsCC,IAAO,IAAQ;EAAA,IAAAC,YAAA;EAC9E;EACA,OAAAA,YAAA,oBAAAC,OAAA,IAAO,cAAcF,IAAI,CAAC;IAWxB;IACA;IACAG,WAAWA,CAACC,MAAkD,EAAEC,OAA2B,EAAE;MAC3F,KAAK,CAACD,MAAM,EAA2BC,OAAO,CAAC;MAACC,2BAAA,OAAAL,YAAA;MAAAM,eAAA;MAAAA,eAAA;MAAAA,eAAA;MAAAA,eAAA,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version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "Allure Jest integration",
5
5
  "keywords": [
6
6
  "jest",
@@ -47,7 +47,7 @@
47
47
  "test": "vitest run"
48
48
  },
49
49
  "dependencies": {
50
- "allure-js-commons": "3.0.1"
50
+ "allure-js-commons": "3.0.3"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@babel/cli": "^7.24.6",
@@ -65,7 +65,7 @@
65
65
  "@typescript-eslint/eslint-plugin": "^8.0.0",
66
66
  "@typescript-eslint/parser": "^8.0.0",
67
67
  "allure-commandline": "^2.29.0",
68
- "allure-vitest": "3.0.1",
68
+ "allure-vitest": "3.0.3",
69
69
  "babel-plugin-add-module-exports": "^1.0.4",
70
70
  "eslint": "^8.57.0",
71
71
  "eslint-config-prettier": "^9.1.0",