@testspectra/react 1.3.5 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -1
- package/dist/setup.js +33 -33
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -64,6 +64,7 @@ function emitEvent(tag, payload) {
|
|
|
64
64
|
console.log(`[${tag}] ${payload}`);
|
|
65
65
|
}
|
|
66
66
|
var stepContext = { index: 0, label: "" };
|
|
67
|
+
var groupStack = [];
|
|
67
68
|
var lastResolved;
|
|
68
69
|
function describeTarget(target) {
|
|
69
70
|
if (target === void 0 || target === null) return "";
|
|
@@ -85,8 +86,17 @@ async function trackStep(category, payloadObj, fn) {
|
|
|
85
86
|
const workerId = globalThis.__TESTSPECTRA_WORKER_ID__;
|
|
86
87
|
if (currentTest && !payloadObj.test) payloadObj.test = currentTest;
|
|
87
88
|
if (workerId !== void 0 && payloadObj.workerId === void 0) payloadObj.workerId = workerId;
|
|
88
|
-
|
|
89
|
+
const group = groupStack[groupStack.length - 1];
|
|
90
|
+
stepContext = {
|
|
91
|
+
index: stepContext.index + 1,
|
|
92
|
+
label: `${payloadObj.key} ${describeTarget(payloadObj.target)}`.trim(),
|
|
93
|
+
group
|
|
94
|
+
};
|
|
89
95
|
payloadObj.step = stepContext.index;
|
|
96
|
+
if (group !== void 0) {
|
|
97
|
+
payloadObj.group = group;
|
|
98
|
+
payloadObj.groupPath = [...groupStack];
|
|
99
|
+
}
|
|
90
100
|
lastResolved = void 0;
|
|
91
101
|
emitEvent("TESTSPECTRA_STEP_START", JSON.stringify(payloadObj));
|
|
92
102
|
const start = Date.now();
|