@autometa/executor 1.0.0-rc.1 → 1.0.0-rc.2

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.d.ts CHANGED
@@ -1,7 +1,11 @@
1
- export { resolveTimeout, chooseTimeout, TimeoutResolution, TimeoutSource } from "./timeouts";
2
- export { collectScenarioHooks, HookCollection, ResolvedHook } from "./hooks";
3
- export { runScenarioExecution, ScenarioRunContext } from "./scenario-runner";
4
- export { registerFeaturePlan, ExecuteFeatureOptions } from "./execute-plan";
1
+ export { resolveTimeout, chooseTimeout } from "./timeouts";
2
+ export type { TimeoutResolution, TimeoutSource } from "./timeouts";
3
+ export { collectScenarioHooks } from "./hooks";
4
+ export type { HookCollection, ResolvedHook } from "./hooks";
5
+ export { runScenarioExecution } from "./scenario-runner";
6
+ export type { ScenarioRunContext } from "./scenario-runner";
7
+ export { registerFeaturePlan } from "./execute-plan";
8
+ export type { ExecuteFeatureOptions } from "./execute-plan";
5
9
  export { ScopeLifecycle, type HookLogEvent, type HookLogListener, type HookLogPathSegment, type HookLogScenarioDetails, type HookLogStepDetails, type HookLogPhase, type HookLifecycleMetadata, type HookLifecycleScenarioMetadata, type HookLifecycleStepMetadata, type HookLifecycleTargetScopeMetadata, } from "./scope-lifecycle";
6
10
  export { selectSuiteByMode, selectTestByMode, resolveModeFromTags } from "./modes";
7
11
  export { createTagFilter, type TagFilter } from "./tag-filter";
package/dist/index.js CHANGED
@@ -330,31 +330,41 @@ function resolveCoerceOverride(shape, coerceOverride) {
330
330
  }
331
331
  return activeConfig[shape];
332
332
  }
333
+ function resolveTableOptions(optionsOrProvider) {
334
+ if (!optionsOrProvider) {
335
+ return void 0;
336
+ }
337
+ if (typeof optionsOrProvider === "function") {
338
+ return new optionsOrProvider();
339
+ }
340
+ return optionsOrProvider;
341
+ }
333
342
  function getTable(world, shape, options) {
334
343
  const table = getRawTable(world);
335
344
  if (!table) {
336
345
  return void 0;
337
346
  }
338
- const coerce = resolveCoerceOverride(shape, options?.coerce);
347
+ const resolvedOptions = resolveTableOptions(options);
348
+ const coerce = resolveCoerceOverride(shape, resolvedOptions?.coerce);
339
349
  switch (shape) {
340
350
  case "headerless":
341
351
  return createTable(table, "headerless", {
342
- ...options,
352
+ ...resolvedOptions,
343
353
  coerce
344
354
  });
345
355
  case "horizontal":
346
356
  return createTable(table, "horizontal", {
347
- ...options,
357
+ ...resolvedOptions,
348
358
  coerce
349
359
  });
350
360
  case "vertical":
351
361
  return createTable(table, "vertical", {
352
- ...options,
362
+ ...resolvedOptions,
353
363
  coerce
354
364
  });
355
365
  case "matrix":
356
366
  return createTable(table, "matrix", {
357
- ...options,
367
+ ...resolvedOptions,
358
368
  coerce
359
369
  });
360
370
  default: