@autometa/executor 1.0.0-rc.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) undefined Ben Aherne
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Introduction
2
+
3
+ There's nothing here yet
@@ -0,0 +1,5 @@
1
+ /// <reference types="node" />
2
+ import { AsyncLocalStorage } from "node:async_hooks";
3
+ export declare const WorldContext: AsyncLocalStorage<unknown>;
4
+ export declare function getWorld<T = unknown>(): T;
5
+ export declare function tryGetWorld<T = unknown>(): T | undefined;
@@ -0,0 +1,5 @@
1
+ import type { SimpleFeature, SimplePickle, SimplePickleFeatureRef, SimplePickleRuleRef, SimplePickleStep, SimpleRule } from "@autometa/gherkin";
2
+ export declare function createFeatureRef(feature: SimpleFeature): SimplePickleFeatureRef;
3
+ export declare function createRuleRef(rule: SimpleRule): SimplePickleRuleRef;
4
+ export declare function requirePickle(feature: SimpleFeature, scenarioId: string): SimplePickle;
5
+ export declare function findPickleStep(pickle: SimplePickle, stepId: string): SimplePickleStep | undefined;
@@ -0,0 +1,13 @@
1
+ import type { ExecutorConfig } from "@autometa/config";
2
+ import type { ScopeExecutionAdapter } from "@autometa/scopes";
3
+ import type { TestPlan } from "@autometa/test-builder";
4
+ import { type HookLogListener } from "./scope-lifecycle";
5
+ import type { ExecutorRuntime } from "./types";
6
+ export interface ExecuteFeatureOptions<World> {
7
+ readonly plan: TestPlan<World>;
8
+ readonly adapter: ScopeExecutionAdapter<World>;
9
+ readonly runtime: ExecutorRuntime;
10
+ readonly config: ExecutorConfig;
11
+ readonly hookLogger?: HookLogListener;
12
+ }
13
+ export declare function registerFeaturePlan<World>(options: ExecuteFeatureOptions<World>): void;
@@ -0,0 +1,19 @@
1
+ import type { HookDefinition, ScopeExecutionAdapter, ScopeNode } from "@autometa/scopes";
2
+ import type { ScenarioExecution } from "@autometa/test-builder";
3
+ export interface ResolvedHook<World> {
4
+ readonly hook: HookDefinition<World>;
5
+ readonly scope: ScopeNode<World>;
6
+ }
7
+ export interface HookCollection<World> {
8
+ readonly beforeFeature: ResolvedHook<World>[];
9
+ readonly afterFeature: ResolvedHook<World>[];
10
+ readonly beforeRule: ResolvedHook<World>[];
11
+ readonly afterRule: ResolvedHook<World>[];
12
+ readonly beforeScenario: ResolvedHook<World>[];
13
+ readonly afterScenario: ResolvedHook<World>[];
14
+ readonly beforeScenarioOutline: ResolvedHook<World>[];
15
+ readonly afterScenarioOutline: ResolvedHook<World>[];
16
+ readonly beforeStep: ResolvedHook<World>[];
17
+ readonly afterStep: ResolvedHook<World>[];
18
+ }
19
+ export declare function collectScenarioHooks<World>(adapter: ScopeExecutionAdapter<World>, execution: ScenarioExecution<World>): HookCollection<World>;