dreamboard 0.1.11 → 0.1.12

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.
@@ -20781,6 +20781,39 @@ var TESTING_TYPES_STUB2 = "export function defineScenario(scenario) { return sce
20781
20781
  var DEFAULT_TIMEOUT_MS = 1e4;
20782
20782
  var BASE_SUFFIX = ".base.ts";
20783
20783
  var SCENARIO_SUFFIX = ".scenario.ts";
20784
+ function formatScenarioErrorForDisplay(options) {
20785
+ const message = options.error.message || "Scenario failed.";
20786
+ const scenarioFrame = findScenarioStackFrame({
20787
+ stack: options.error.stack,
20788
+ projectRoot: options.projectRoot,
20789
+ scenarioFilePath: options.scenarioFilePath
20790
+ });
20791
+ return scenarioFrame ? `${message}
20792
+ ${scenarioFrame}` : message;
20793
+ }
20794
+ function findScenarioStackFrame(options) {
20795
+ if (!options.stack) {
20796
+ return null;
20797
+ }
20798
+ const absolutePath = path20.resolve(options.scenarioFilePath);
20799
+ const relativePath = path20.relative(options.projectRoot, absolutePath);
20800
+ const normalizedRelativePath = relativePath.split(path20.sep).join("/");
20801
+ const escapedAbsolutePath = escapeRegExp(absolutePath);
20802
+ const escapedRelativePath = escapeRegExp(normalizedRelativePath);
20803
+ const absoluteFrame = new RegExp(`${escapedAbsolutePath}:(\\d+):(\\d+)`);
20804
+ const relativeFrame = new RegExp(`${escapedRelativePath}:(\\d+):(\\d+)`);
20805
+ for (const line of options.stack.split("\n")) {
20806
+ const normalizedLine = line.split(path20.sep).join("/");
20807
+ const match = normalizedLine.match(absoluteFrame) ?? normalizedLine.match(relativeFrame);
20808
+ if (match?.[1] && match?.[2]) {
20809
+ return `at ${normalizedRelativePath}:${match[1]}:${match[2]}`;
20810
+ }
20811
+ }
20812
+ return null;
20813
+ }
20814
+ function escapeRegExp(value) {
20815
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
20816
+ }
20784
20817
  var testingExpectApiFactoryPromise;
20785
20818
  async function loadTestingExpectApiFactory() {
20786
20819
  testingExpectApiFactoryPromise ??= import("./src-X7NGTW44.js").then(
@@ -22840,7 +22873,11 @@ async function runReducerNativeScenarios(options) {
22840
22873
  results.push({
22841
22874
  id: scenario.definition.id,
22842
22875
  success: false,
22843
- error: error instanceof Error ? error.message : `Scenario '${scenario.definition.id}' failed.`
22876
+ error: error instanceof Error ? formatScenarioErrorForDisplay({
22877
+ error,
22878
+ projectRoot: options.projectRoot,
22879
+ scenarioFilePath: scenario.filePath
22880
+ }) : `Scenario '${scenario.definition.id}' failed.`
22844
22881
  });
22845
22882
  }
22846
22883
  }
@@ -26070,4 +26107,4 @@ export {
26070
26107
  test_default,
26071
26108
  runDreamboardCli
26072
26109
  };
26073
- //# sourceMappingURL=chunk-UKKYXDQT.js.map
26110
+ //# sourceMappingURL=chunk-PF3XY67X.js.map