@specter-automation/test 1.0.119 → 1.0.121
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.
|
@@ -633,6 +633,9 @@ class SpecterWorld {
|
|
|
633
633
|
const properties = options?.properties;
|
|
634
634
|
const spawnController = options?.spawnController;
|
|
635
635
|
await this.evaluate("SpawnActor", { assetPath, tag, location, rotation, properties, spawnController }, assetName, tag);
|
|
636
|
+
if (options?.name) {
|
|
637
|
+
return this.actorByTag(tag).named(options.name);
|
|
638
|
+
}
|
|
636
639
|
return this.actorByTag(tag);
|
|
637
640
|
}
|
|
638
641
|
// ==========================================
|
|
@@ -18,6 +18,8 @@ export default class SpecterReporter implements Reporter {
|
|
|
18
18
|
private readMatcherReport;
|
|
19
19
|
private getParentStepName;
|
|
20
20
|
onStepBegin(test: TestCase, result: TestResult, step: TestStep): void;
|
|
21
|
+
/** Where a step is written in the spec, for "open at line" in the runner. */
|
|
22
|
+
private locationOf;
|
|
21
23
|
private customStepDurations;
|
|
22
24
|
onStepEnd(test: TestCase, result: TestResult, step: TestStep): void;
|
|
23
25
|
private formatError;
|
|
@@ -231,10 +231,17 @@ class SpecterReporter {
|
|
|
231
231
|
// The wrapper stands in for its outer expect step, so report the expect step's parent
|
|
232
232
|
// (the same parent its step_ended event will carry), not the expect step itself.
|
|
233
233
|
parentStepName: this.getParentStepName(isCustomWrapper ? step.parent : step),
|
|
234
|
-
category: category
|
|
234
|
+
category: category,
|
|
235
|
+
// The wrapper's own location is inside Specter; the expect step points at the user's line
|
|
236
|
+
location: this.locationOf(isCustomWrapper ? step.parent : step)
|
|
235
237
|
}
|
|
236
238
|
});
|
|
237
239
|
}
|
|
240
|
+
/** Where a step is written in the spec, for "open at line" in the runner. */
|
|
241
|
+
locationOf(step) {
|
|
242
|
+
const location = step.location;
|
|
243
|
+
return location ? { file: location.file, line: location.line } : undefined;
|
|
244
|
+
}
|
|
238
245
|
customStepDurations = new WeakMap();
|
|
239
246
|
onStepEnd(test, result, step) {
|
|
240
247
|
const uniqueTestKey = `${test.parent.title} > ${test.title}`;
|
|
@@ -261,7 +268,8 @@ class SpecterReporter {
|
|
|
261
268
|
testName: uniqueTestKey,
|
|
262
269
|
stepName: uniqueStepName,
|
|
263
270
|
parentStepName: this.getParentStepName(step),
|
|
264
|
-
category: 'expect'
|
|
271
|
+
category: 'expect',
|
|
272
|
+
location: this.locationOf(step)
|
|
265
273
|
}
|
|
266
274
|
});
|
|
267
275
|
}
|