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