@autometa/app 0.4.2 → 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/README.md +1 -1
- package/dist/create-step-definitions.d.ts +11 -0
- package/dist/index.cjs +499 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2 -110
- package/dist/index.js +489 -63
- package/dist/index.js.map +1 -1
- package/dist/internal/default-dsl.d.ts +2 -0
- package/dist/internal/scope-manager.d.ts +42 -0
- package/dist/types.d.ts +126 -0
- package/package.json +27 -44
- package/.eslintignore +0 -3
- package/.eslintrc.cjs +0 -4
- package/.turbo/turbo-build.log +0 -21
- package/.turbo/turbo-clean.log +0 -4
- package/.turbo/turbo-coverage.log +0 -22
- package/.turbo/turbo-lint$colon$fix.log +0 -4
- package/.turbo/turbo-lint.log +0 -4
- package/.turbo/turbo-lint:fix.log +0 -4
- package/.turbo/turbo-prettify.log +0 -0
- package/.turbo/turbo-test.log +0 -12
- package/CHANGELOG.md +0 -234
- package/dist/esm/index.js +0 -41
- package/dist/esm/index.js.map +0 -1
- package/dist/index.d.cts +0 -110
- package/tsup.config.ts +0 -14
- package/vite.config.ts +0 -10
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/autometa-app.ts","../src/autometa-world.ts","../src/get-app.ts","../src/decorators/app-type.ts"],"sourcesContent":["export * from \"./autometa-app\";\nexport * from \"./autometa-world\";\nexport * from \"./get-app\";\nexport * from \"./decorators\";\nexport * from \"./fixtures.typings\";\n","import { World } from \"./fixtures.typings\";\nexport abstract class AutometaApp {\n id: string;\n [key: string]: unknown;\n world: World;\n}\n","export class AutometaWorld {}\n","import { AutometaApp } from \"./autometa-app\";\nimport { Class } from \"@autometa/types\";\nimport { v4 } from \"uuid\";\nimport { Container, defineContainerContext } from \"@autometa/injection\";\nimport { App } from \"./fixtures.typings\";\n\nexport function getApp<T extends AutometaApp>(\n appType: Class<T>,\n containerName = v4()\n): App {\n const context = defineContainerContext(containerName);\n const container = new Container(context);\n const app = container.get<App>(appType);\n app.di = container;\n return app;\n}\n","import { Class } from \"@autometa/types\";\nimport { App, World, AutometaWorld } from \"..\";\nimport { metadata } from \"@autometa/injection\";\nexport function AppType(\n container: Record<string, { app: Class<App>; world: Class<World> }>,\n world: Class<AutometaWorld>,\n environment = \"default\"\n) {\n const env = environment ?? \"default\";\n return (target: Class<unknown>) => {\n metadata(target).set({\n key: \"world\",\n class: world,\n });\n container[env] = {\n app: target as Class<App>,\n world: world as Class<World>,\n };\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCO,IAAe,cAAf,MAA2B;AAIlC;;;ACLO,IAAM,gBAAN,MAAoB;AAAC;;;ACE5B,kBAAmB;AACnB,uBAAkD;AAG3C,SAAS,OACd,SACA,oBAAgB,gBAAG,GACd;AACL,QAAM,cAAU,yCAAuB,aAAa;AACpD,QAAM,YAAY,IAAI,2BAAU,OAAO;AACvC,QAAM,MAAM,UAAU,IAAS,OAAO;AACtC,MAAI,KAAK;AACT,SAAO;AACT;;;ACbA,IAAAA,oBAAyB;AAClB,SAAS,QACd,WACA,OACA,cAAc,WACd;AACA,QAAM,MAAM,eAAe;AAC3B,SAAO,CAAC,WAA2B;AACjC,oCAAS,MAAM,EAAE,IAAI;AAAA,MACnB,KAAK;AAAA,MACL,OAAO;AAAA,IACT,CAAC;AACD,cAAU,GAAG,IAAI;AAAA,MACf,KAAK;AAAA,MACL;AAAA,IACF;AAAA,EACF;AACF;","names":["import_injection"]}
|
|
1
|
+
{"version":3,"sources":["../src/create-step-definitions.ts","../src/internal/scope-manager.ts"],"names":["AutomationError"],"mappings":";AAAA,SAAS,mBAAAA,wBAAuB;;;ACAhC,SAAS,WAAW,aAAa;AACjC,SAAS,uBAAuB;AAsDzB,IAAM,eAAN,MAML;AAAA,EAsBA,YAA6B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QAAQ,MAAM,QAAQ,QAAQ,QAAQ,eAAe;AAAA,EACtE;AACF;AAEA,SAAS,iBAAiB,QAA8B;AACtD,MAAI,UAAU;AACd,SAAO,MAAM,GAAG,MAAM,IAAI,EAAE,OAAO;AACrC","sourcesContent":["import { AutomationError } from \"@autometa/errors\";\nimport type {\n StepSuite,\n StepFactoryOptions,\n StepDsl,\n StepExpression,\n StepCallback,\n HookSuite,\n StepFlowBuilder,\n} from \"./types\";\nimport type { WorldCtor, ScopeKeyResolver, StepRuntimeContext } from \"./types\";\nimport { ScopeManager } from \"./internal/scope-manager\";\n\ninterface FlowCreator {\n <\n TScenario extends object,\n TFeature extends object | undefined = undefined,\n TRule extends object | undefined = undefined,\n TOutline extends object | undefined = undefined,\n Ctx = StepRuntimeContext\n >(\n scenario: WorldCtor<TScenario>,\n options?: StepFactoryOptions<TFeature, TRule, TOutline, Ctx>\n ): StepFlowBuilder;\n}\n\ninterface StepDefinitionsFactory {\n <\n TScenario extends object,\n TFeature extends object | undefined = undefined,\n TRule extends object | undefined = undefined,\n TOutline extends object | undefined = undefined,\n Ctx = StepRuntimeContext\n >(\n scenario: WorldCtor<TScenario>,\n options?: StepFactoryOptions<TFeature, TRule, TOutline, Ctx>\n ): StepSuite<TScenario, TFeature, TRule, TOutline, Ctx>;\n flow: FlowCreator;\n}\n\nfunction baseCreateStepDefinitions<\n TScenario extends object,\n TFeature extends object | undefined = undefined,\n TRule extends object | undefined = undefined,\n TOutline extends object | undefined = undefined,\n Ctx = StepRuntimeContext\n>(\n scenarioCtor: WorldCtor<TScenario>,\n options: StepFactoryOptions<TFeature, TRule, TOutline, Ctx> = {}\n): StepSuite<TScenario, TFeature, TRule, TOutline, Ctx> {\n const dsl = resolveDsl(options.dsl);\n const keyResolver = (options.keyResolver ?? defaultKeyResolver) as ScopeKeyResolver<Ctx>;\n\n const manager = new ScopeManager<TScenario, TFeature, TRule, TOutline, Ctx>({\n scenario: scenarioCtor,\n keyResolver,\n ...(options.feature ? { feature: options.feature } : {}),\n ...(options.rule ? { rule: options.rule } : {}),\n ...(options.outline ? { outline: options.outline } : {}),\n });\n\n if (Array.isArray(options.expressions) && dsl.defineParameterType) {\n for (const definition of options.expressions) {\n dsl.defineParameterType(definition);\n }\n }\n\n setupLifecycleHooks(dsl, manager);\n\n const given = wrapStepRegistrar(\"Given\", dsl, dsl.Given, manager);\n const when = wrapStepRegistrar(\"When\", dsl, dsl.When, manager);\n const then = wrapStepRegistrar(\"Then\", dsl, dsl.Then, manager);\n const and = wrapStepRegistrar(\"And\", dsl, dsl.And ?? dsl.Given, manager);\n const but = wrapStepRegistrar(\"But\", dsl, dsl.But ?? dsl.Given, manager);\n\n const hooks: HookSuite<TScenario, TFeature, TRule, TOutline, Ctx> = {\n BeforeFeature(handler) {\n manager.onEnter(\"feature\", handler);\n },\n AfterFeature(handler) {\n manager.onExit(\"feature\", handler);\n },\n BeforeRule(handler) {\n manager.onEnter(\"rule\", handler);\n },\n AfterRule(handler) {\n manager.onExit(\"rule\", handler);\n },\n BeforeOutline(handler) {\n manager.onEnter(\"outline\", handler);\n },\n AfterOutline(handler) {\n manager.onExit(\"outline\", handler);\n },\n BeforeScenario(handler) {\n manager.onEnter(\"scenario\", handler);\n },\n AfterScenario(handler) {\n manager.onExit(\"scenario\", handler);\n },\n };\n\n const flow = createFlowBuilder({\n given,\n when,\n then,\n and,\n but,\n });\n\n return {\n Given: given,\n When: when,\n Then: then,\n And: and,\n But: but,\n hooks,\n flow,\n } satisfies StepSuite<TScenario, TFeature, TRule, TOutline, Ctx>;\n}\n\nexport const createStepDefinitions: StepDefinitionsFactory = Object.assign(\n baseCreateStepDefinitions as StepDefinitionsFactory,\n {\n flow: ((scenarioCtor, options) =>\n baseCreateStepDefinitions(scenarioCtor as never, options as never).flow) as FlowCreator,\n }\n);\n\nfunction resolveDsl(dsl: StepDsl | undefined): StepDsl {\n if (!dsl) {\n throw new AutomationError(\n \"Step-definition DSL is required. Pass an explicit dsl option when creating step definitions.\"\n );\n }\n\n return ensureRegistrars(dsl);\n}\n\nfunction ensureRegistrars(dsl: StepDsl): StepDsl {\n if (!dsl.Given || !dsl.When || !dsl.Then) {\n throw new AutomationError(\"Step DSL must provide Given, When, and Then registrars.\");\n }\n return dsl;\n}\n\nfunction wrapStepRegistrar<\n TScenario extends object,\n TFeature extends object | undefined,\n TRule extends object | undefined,\n TOutline extends object | undefined,\n Ctx\n>(\n keyword: string,\n dsl: StepDsl,\n registrar: StepDsl[\"Given\"] | undefined,\n manager: ScopeManager<TScenario, TFeature, TRule, TOutline, Ctx>\n) {\n if (!registrar) {\n return () => {\n throw new AutomationError(`Step DSL does not expose a registrar for ${keyword}.`);\n };\n }\n\n return (expression: StepExpression, handler: StepCallback) => {\n const wrapped = createStepWrapper(keyword, expression, handler, manager);\n registrar.call(dsl, expression, wrapped);\n };\n}\n\nfunction createStepWrapper<\n TScenario extends object,\n TFeature extends object | undefined,\n TRule extends object | undefined,\n TOutline extends object | undefined,\n Ctx\n>(\n keyword: string,\n expression: StepExpression,\n handler: StepCallback,\n manager: ScopeManager<TScenario, TFeature, TRule, TOutline, Ctx>\n) {\n return async function stepExecution(this: unknown, ...args: unknown[]) {\n if (!manager.hasScenario()) {\n const context = resolveRuntimeContext<Ctx>(undefined, this);\n const keys = manager.resolveKeys(context);\n await manager.startScenario(context, keys);\n }\n\n const { scenario } = manager.getHierarchy();\n\n try {\n if (expectsThis(handler)) {\n return await handler.apply(scenario, args);\n }\n\n return await handler(scenario, ...args);\n } catch (error) {\n throw wrapStepError(error, keyword, expression);\n }\n };\n}\n\nfunction expectsThis(handler: StepCallback): boolean {\n return Boolean((handler as { prototype?: unknown }).prototype);\n}\n\nfunction wrapStepError(error: unknown, keyword: string, expression: StepExpression): AutomationError {\n if (error instanceof AutomationError) {\n return error;\n }\n\n const baseMessage =\n error instanceof Error ? error.message : typeof error === \"string\" ? error : \"Unknown error\";\n const message = `Step failed for ${keyword} ${String(expression)}: ${baseMessage}`;\n\n return new AutomationError(message, {\n cause: error instanceof Error ? error : undefined,\n });\n}\n\nfunction resolveRuntimeContext<Ctx>(hookArg: unknown, worldValue: unknown): Ctx {\n if (hookArg && typeof hookArg === \"object\") {\n return hookArg as Ctx;\n }\n if (worldValue && typeof worldValue === \"object\") {\n return worldValue as Ctx;\n }\n return {} as Ctx;\n}\n\nfunction setupLifecycleHooks<\n TScenario extends object,\n TFeature extends object | undefined,\n TRule extends object | undefined,\n TOutline extends object | undefined,\n Ctx\n>(dsl: StepDsl, manager: ScopeManager<TScenario, TFeature, TRule, TOutline, Ctx>): void {\n if (dsl.Before) {\n dsl.Before.call(dsl, async function beforeScenario(this: unknown, context: unknown) {\n const runtime = resolveRuntimeContext<Ctx>(context, this);\n await manager.startScenario(runtime);\n });\n }\n\n if (dsl.After) {\n dsl.After.call(dsl, async function afterScenario(this: unknown, context: unknown) {\n const runtime = resolveRuntimeContext<Ctx>(context, this);\n await manager.finishScenario(runtime);\n });\n }\n\n if (dsl.AfterAll) {\n dsl.AfterAll.call(dsl, async function afterAll(this: unknown) {\n const runtime = resolveRuntimeContext<Ctx>(undefined, this);\n await manager.resetAll(runtime);\n });\n }\n}\n\nfunction createFlowBuilder(registrars: {\n readonly given: (expression: StepExpression, handler: StepCallback) => void;\n readonly when: (expression: StepExpression, handler: StepCallback) => void;\n readonly then: (expression: StepExpression, handler: StepCallback) => void;\n readonly and: (expression: StepExpression, handler: StepCallback) => void;\n readonly but: (expression: StepExpression, handler: StepCallback) => void;\n}): StepFlowBuilder {\n const builder: StepFlowBuilder = {\n given: (expression) => createFlowRunner(registrars.given, expression, () => builder),\n when: (expression) => createFlowRunner(registrars.when, expression, () => builder),\n then: (expression) => createFlowRunner(registrars.then, expression, () => builder),\n and: (expression) => createFlowRunner(registrars.and, expression, () => builder),\n but: (expression) => createFlowRunner(registrars.but, expression, () => builder),\n };\n\n return builder;\n}\n\nfunction createFlowRunner(\n registrar: (expression: StepExpression, handler: StepCallback) => void,\n expression: StepExpression,\n next: () => StepFlowBuilder\n) {\n return {\n run(handler: StepCallback) {\n registrar(expression, handler);\n return next();\n },\n };\n}\n\nconst nextScenarioId = createKeyFactory(\"scenario\");\n\nconst defaultKeyResolver: ScopeKeyResolver<StepRuntimeContext> = {\n feature(context) {\n return context.gherkinDocument?.feature?.name ?? context.pickle?.uri ?? undefined;\n },\n rule(context) {\n const nodes = context.pickle?.astNodeIds;\n return Array.isArray(nodes) && nodes.length > 1 ? nodes[0] : undefined;\n },\n outline(context) {\n const nodes = context.pickle?.astNodeIds;\n if (Array.isArray(nodes) && nodes.length > 1) {\n return nodes.slice(1).join(\":\");\n }\n return undefined;\n },\n scenario(context) {\n return context.pickle?.id ?? context.pickle?.name ?? nextScenarioId();\n },\n};\n\nfunction createKeyFactory(prefix: string): () => string {\n let counter = 0;\n return () => `${prefix}-${++counter}`;\n}\n","import { Container, Scope } from \"@autometa/injection\";\nimport { AutomationError } from \"@autometa/errors\";\nimport type {\n HookCallback,\n DefinedWorld,\n OptionalWorld,\n ScopeKeyResolver,\n ScopeKeys,\n ScopePayload,\n StepRuntimeContext,\n WorldCtor,\n WorldHierarchy,\n WorldScope,\n} from \"../types\";\n\ninterface ScopeState<T extends object, C> {\n readonly ctor: WorldCtor<T>;\n readonly container: Container;\n readonly key: string;\n instance: T;\n context: C;\n}\n\ntype EnterHandlers<\n TScenario extends object,\n TFeature extends object | undefined,\n TRule extends object | undefined,\n TOutline extends object | undefined,\n Ctx\n> = {\n [S in WorldScope]: Set<HookCallback<S, TScenario, TFeature, TRule, TOutline, Ctx>>;\n};\n\ntype ExitHandlers<\n TScenario extends object,\n TFeature extends object | undefined,\n TRule extends object | undefined,\n TOutline extends object | undefined,\n Ctx\n> = EnterHandlers<TScenario, TFeature, TRule, TOutline, Ctx>;\n\nexport interface ScopeManagerOptions<\n TScenario extends object,\n TFeature extends object | undefined,\n TRule extends object | undefined,\n TOutline extends object | undefined,\n Ctx = StepRuntimeContext\n> {\n readonly scenario: WorldCtor<TScenario>;\n readonly feature?: WorldCtor<DefinedWorld<TFeature>>;\n readonly rule?: WorldCtor<DefinedWorld<TRule>>;\n readonly outline?: WorldCtor<DefinedWorld<TOutline>>;\n readonly keyResolver: ScopeKeyResolver<Ctx>;\n}\n\nexport class ScopeManager<\n TScenario extends object,\n TFeature extends object | undefined,\n TRule extends object | undefined,\n TOutline extends object | undefined,\n Ctx = StepRuntimeContext\n> {\n private readonly root = new Container();\n\n private feature: ScopeState<DefinedWorld<TFeature>, Ctx> | undefined;\n private rule: ScopeState<DefinedWorld<TRule>, Ctx> | undefined;\n private outline: ScopeState<DefinedWorld<TOutline>, Ctx> | undefined;\n private scenario: ScopeState<TScenario, Ctx> | undefined;\n\n private readonly enterHandlers: EnterHandlers<TScenario, TFeature, TRule, TOutline, Ctx> = {\n feature: new Set(),\n rule: new Set(),\n outline: new Set(),\n scenario: new Set(),\n } as EnterHandlers<TScenario, TFeature, TRule, TOutline, Ctx>;\n\n private readonly exitHandlers: ExitHandlers<TScenario, TFeature, TRule, TOutline, Ctx> = {\n feature: new Set(),\n rule: new Set(),\n outline: new Set(),\n scenario: new Set(),\n } as ExitHandlers<TScenario, TFeature, TRule, TOutline, Ctx>;\n\n constructor(private readonly options: ScopeManagerOptions<TScenario, TFeature, TRule, TOutline, Ctx>) {}\n\n getHierarchy(): WorldHierarchy<TScenario, OptionalWorld<TFeature>, OptionalWorld<TRule>, OptionalWorld<TOutline>> {\n if (!this.scenario) {\n throw new AutomationError(\"Scenario world has not been initialised yet.\");\n }\n\n return {\n scenario: this.scenario.instance,\n feature: (this.feature?.instance ?? undefined) as OptionalWorld<TFeature>,\n rule: (this.rule?.instance ?? undefined) as OptionalWorld<TRule>,\n outline: (this.outline?.instance ?? undefined) as OptionalWorld<TOutline>,\n } satisfies WorldHierarchy<TScenario, OptionalWorld<TFeature>, OptionalWorld<TRule>, OptionalWorld<TOutline>>;\n }\n\n async startScenario(rawContext: Ctx | undefined, explicitKeys?: ScopeKeys): Promise<void> {\n const context = rawContext ?? ({} as Ctx);\n const keys = explicitKeys ?? this.resolveKeys(context);\n\n await this.ensureFeature(keys, context);\n await this.ensureRule(keys, context);\n await this.ensureOutline(keys, context);\n\n if (this.scenario) {\n await this.disposeScenario(false);\n }\n\n this.scenario = this.createScopeState(\n this.options.scenario,\n keys.scenario,\n this.parentContainerFor(\"scenario\"),\n context\n );\n\n this.syncHierarchyReferences();\n await this.triggerEnter(\"scenario\", context);\n }\n\n async finishScenario(context?: Ctx): Promise<void> {\n await this.disposeScenario(true, context);\n }\n\n async resetAll(context?: Ctx): Promise<void> {\n await this.disposeScenario(true, context);\n await this.disposeOutline(context);\n await this.disposeRule(context);\n await this.disposeFeature(context);\n }\n\n onEnter<Scope extends WorldScope>(\n scope: Scope,\n handler: HookCallback<Scope, TScenario, TFeature, TRule, TOutline, Ctx>\n ): void {\n (this.enterHandlers[scope] as Set<HookCallback<Scope, TScenario, TFeature, TRule, TOutline, Ctx>>).add(handler);\n }\n\n onExit<Scope extends WorldScope>(\n scope: Scope,\n handler: HookCallback<Scope, TScenario, TFeature, TRule, TOutline, Ctx>\n ): void {\n (this.exitHandlers[scope] as Set<HookCallback<Scope, TScenario, TFeature, TRule, TOutline, Ctx>>).add(handler);\n }\n\n resolveKeys(context: Ctx): ScopeKeys {\n const { keyResolver } = this.options;\n const result: ScopeKeys = {\n scenario: keyResolver.scenario(context),\n };\n\n const feature = keyResolver.feature?.(context);\n if (feature) {\n result.feature = feature;\n }\n\n const rule = keyResolver.rule?.(context);\n if (rule) {\n result.rule = rule;\n }\n\n const outline = keyResolver.outline?.(context);\n if (outline) {\n result.outline = outline;\n }\n\n if (!result.feature) {\n result.feature = \"feature\";\n }\n\n return result;\n }\n\n hasScenario(): boolean {\n return Boolean(this.scenario);\n }\n\n private parentContainerFor(scope: WorldScope): Container {\n switch (scope) {\n case \"feature\":\n return this.root;\n case \"rule\":\n return this.feature?.container ?? this.root;\n case \"outline\":\n return this.rule?.container ?? this.feature?.container ?? this.root;\n case \"scenario\":\n default:\n return this.outline?.container ?? this.rule?.container ?? this.feature?.container ?? this.root;\n }\n }\n\n private ensureFeature(keys: ScopeKeys, context: Ctx): Promise<void> | void {\n const featureCtor = this.options.feature;\n if (!featureCtor) {\n return;\n }\n\n if (this.feature && this.feature.key === keys.feature) {\n return;\n }\n\n return this.replaceFeature(featureCtor, keys.feature ?? \"feature\", context);\n }\n\n private async ensureRule(keys: ScopeKeys, context: Ctx): Promise<void> {\n const ruleCtor = this.options.rule;\n if (!ruleCtor) {\n return;\n }\n\n if (this.rule && this.rule.key === keys.rule) {\n return;\n }\n\n await this.disposeRule(context);\n\n if (!keys.rule) {\n return;\n }\n\n this.rule = this.createScopeState(\n ruleCtor,\n keys.rule,\n this.parentContainerFor(\"rule\"),\n context\n );\n this.syncHierarchyReferences();\n await this.triggerEnter(\"rule\", context);\n }\n\n private async ensureOutline(keys: ScopeKeys, context: Ctx): Promise<void> {\n const outlineCtor = this.options.outline;\n if (!outlineCtor) {\n return;\n }\n\n if (this.outline && this.outline.key === keys.outline) {\n return;\n }\n\n await this.disposeOutline(context);\n\n if (!keys.outline) {\n return;\n }\n\n this.outline = this.createScopeState(\n outlineCtor,\n keys.outline,\n this.parentContainerFor(\"outline\"),\n context\n );\n this.syncHierarchyReferences();\n await this.triggerEnter(\"outline\", context);\n }\n\n private async replaceFeature(\n ctor: WorldCtor<DefinedWorld<TFeature>>,\n key: string,\n context: Ctx\n ): Promise<void> {\n await this.disposeFeature(context);\n\n this.feature = this.createScopeState(ctor, key, this.parentContainerFor(\"feature\"), context);\n this.syncHierarchyReferences();\n await this.triggerEnter(\"feature\", context);\n }\n\n private createScopeState<T extends object>(\n ctor: WorldCtor<T>,\n key: string,\n parent: Container,\n context: Ctx\n ): ScopeState<T, Ctx> {\n const container = parent.createChild() as Container;\n container.registerClass(ctor, { scope: Scope.SINGLETON });\n const instance = container.resolve(ctor);\n return { ctor, key, container, instance, context } satisfies ScopeState<T, Ctx>;\n }\n\n private async disposeScenario(runHandlers: boolean, context?: Ctx): Promise<void> {\n if (!this.scenario) {\n return;\n }\n\n if (runHandlers) {\n await this.triggerExit(\"scenario\", context ?? this.scenario.context);\n }\n\n await this.scenario.container.dispose();\n this.scenario = undefined;\n }\n\n private async disposeOutline(context?: Ctx): Promise<void> {\n if (!this.outline) {\n return;\n }\n\n await this.triggerExit(\"outline\", context ?? this.outline.context);\n await this.outline.container.dispose();\n this.outline = undefined;\n }\n\n private async disposeRule(context?: Ctx): Promise<void> {\n if (!this.rule) {\n return;\n }\n\n await this.triggerExit(\"rule\", context ?? this.rule.context);\n await this.rule.container.dispose();\n this.rule = undefined;\n }\n\n private async disposeFeature(context?: Ctx): Promise<void> {\n if (!this.feature) {\n return;\n }\n\n await this.triggerExit(\"feature\", context ?? this.feature.context);\n await this.feature.container.dispose();\n this.feature = undefined;\n }\n\n private async triggerEnter(scope: WorldScope, context: Ctx): Promise<void> {\n const handlers = this.enterHandlers[scope];\n if (!handlers.size) {\n return;\n }\n\n const payload = this.createPayload(scope);\n for (const handler of handlers) {\n // eslint-disable-next-line no-await-in-loop\n await handler(payload as never, context);\n }\n }\n\n private async triggerExit(scope: WorldScope, context: Ctx): Promise<void> {\n const handlers = this.exitHandlers[scope];\n if (!handlers.size) {\n return;\n }\n\n const payload = this.createPayload(scope);\n for (const handler of handlers) {\n // eslint-disable-next-line no-await-in-loop\n await handler(payload as never, context);\n }\n }\n\n private createPayload(scope: WorldScope): ScopePayload<\n typeof scope,\n TScenario,\n OptionalWorld<TFeature>,\n OptionalWorld<TRule>,\n OptionalWorld<TOutline>\n > {\n switch (scope) {\n case \"feature\":\n if (!this.feature) {\n throw new AutomationError(\"Feature world has not been initialised.\");\n }\n return { feature: this.feature.instance } as never;\n case \"rule\":\n if (!this.rule) {\n throw new AutomationError(\"Rule world has not been initialised.\");\n }\n return {\n feature: (this.feature?.instance ?? undefined) as OptionalWorld<TFeature>,\n rule: this.rule.instance,\n } as never;\n case \"outline\":\n if (!this.outline) {\n throw new AutomationError(\"Outline world has not been initialised.\");\n }\n return {\n feature: (this.feature?.instance ?? undefined) as OptionalWorld<TFeature>,\n rule: (this.rule?.instance ?? undefined) as OptionalWorld<TRule>,\n outline: this.outline.instance,\n } as never;\n case \"scenario\":\n default:\n if (!this.scenario) {\n throw new AutomationError(\"Scenario world has not been initialised.\");\n }\n return {\n feature: (this.feature?.instance ?? undefined) as OptionalWorld<TFeature>,\n rule: (this.rule?.instance ?? undefined) as OptionalWorld<TRule>,\n outline: (this.outline?.instance ?? undefined) as OptionalWorld<TOutline>,\n scenario: this.scenario.instance,\n } as never;\n }\n }\n\n private syncHierarchyReferences(): void {\n if (this.rule?.instance && this.feature?.instance) {\n this.attachParent(this.rule.instance, \"feature\", this.feature.instance);\n }\n\n if (this.outline?.instance) {\n if (this.feature?.instance) {\n this.attachParent(this.outline.instance, \"feature\", this.feature.instance);\n }\n if (this.rule?.instance) {\n this.attachParent(this.outline.instance, \"rule\", this.rule.instance);\n }\n }\n\n if (this.scenario?.instance) {\n if (this.feature?.instance) {\n this.attachParent(this.scenario.instance, \"feature\", this.feature.instance);\n }\n if (this.rule?.instance) {\n this.attachParent(this.scenario.instance, \"rule\", this.rule.instance);\n }\n if (this.outline?.instance) {\n this.attachParent(this.scenario.instance, \"outline\", this.outline.instance);\n }\n }\n }\n\n private attachParent(target: object, property: string, value: object): void {\n if (property in target && Reflect.get(target, property) === value) {\n return;\n }\n\n Object.defineProperty(target, property, {\n value,\n enumerable: false,\n configurable: true,\n writable: false,\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { HookCallback, DefinedWorld, OptionalWorld, ScopeKeyResolver, ScopeKeys, StepRuntimeContext, WorldCtor, WorldHierarchy, WorldScope } from "../types";
|
|
2
|
+
export interface ScopeManagerOptions<TScenario extends object, TFeature extends object | undefined, TRule extends object | undefined, TOutline extends object | undefined, Ctx = StepRuntimeContext> {
|
|
3
|
+
readonly scenario: WorldCtor<TScenario>;
|
|
4
|
+
readonly feature?: WorldCtor<DefinedWorld<TFeature>>;
|
|
5
|
+
readonly rule?: WorldCtor<DefinedWorld<TRule>>;
|
|
6
|
+
readonly outline?: WorldCtor<DefinedWorld<TOutline>>;
|
|
7
|
+
readonly keyResolver: ScopeKeyResolver<Ctx>;
|
|
8
|
+
}
|
|
9
|
+
export declare class ScopeManager<TScenario extends object, TFeature extends object | undefined, TRule extends object | undefined, TOutline extends object | undefined, Ctx = StepRuntimeContext> {
|
|
10
|
+
private readonly options;
|
|
11
|
+
private readonly root;
|
|
12
|
+
private feature;
|
|
13
|
+
private rule;
|
|
14
|
+
private outline;
|
|
15
|
+
private scenario;
|
|
16
|
+
private readonly enterHandlers;
|
|
17
|
+
private readonly exitHandlers;
|
|
18
|
+
constructor(options: ScopeManagerOptions<TScenario, TFeature, TRule, TOutline, Ctx>);
|
|
19
|
+
getHierarchy(): WorldHierarchy<TScenario, OptionalWorld<TFeature>, OptionalWorld<TRule>, OptionalWorld<TOutline>>;
|
|
20
|
+
startScenario(rawContext: Ctx | undefined, explicitKeys?: ScopeKeys): Promise<void>;
|
|
21
|
+
finishScenario(context?: Ctx): Promise<void>;
|
|
22
|
+
resetAll(context?: Ctx): Promise<void>;
|
|
23
|
+
onEnter<Scope extends WorldScope>(scope: Scope, handler: HookCallback<Scope, TScenario, TFeature, TRule, TOutline, Ctx>): void;
|
|
24
|
+
onExit<Scope extends WorldScope>(scope: Scope, handler: HookCallback<Scope, TScenario, TFeature, TRule, TOutline, Ctx>): void;
|
|
25
|
+
resolveKeys(context: Ctx): ScopeKeys;
|
|
26
|
+
hasScenario(): boolean;
|
|
27
|
+
private parentContainerFor;
|
|
28
|
+
private ensureFeature;
|
|
29
|
+
private ensureRule;
|
|
30
|
+
private ensureOutline;
|
|
31
|
+
private replaceFeature;
|
|
32
|
+
private createScopeState;
|
|
33
|
+
private disposeScenario;
|
|
34
|
+
private disposeOutline;
|
|
35
|
+
private disposeRule;
|
|
36
|
+
private disposeFeature;
|
|
37
|
+
private triggerEnter;
|
|
38
|
+
private triggerExit;
|
|
39
|
+
private createPayload;
|
|
40
|
+
private syncHierarchyReferences;
|
|
41
|
+
private attachParent;
|
|
42
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { Constructor } from "@autometa/injection";
|
|
2
|
+
export type WorldCtor<T extends object> = Constructor<T>;
|
|
3
|
+
export type WorldScope = "feature" | "rule" | "outline" | "scenario";
|
|
4
|
+
export type OptionalWorld<T> = T extends object ? T : undefined;
|
|
5
|
+
export type DefinedWorld<T> = T extends object ? T : never;
|
|
6
|
+
export interface ScopeKeys {
|
|
7
|
+
feature?: string;
|
|
8
|
+
rule?: string;
|
|
9
|
+
outline?: string;
|
|
10
|
+
scenario: string;
|
|
11
|
+
}
|
|
12
|
+
export interface WorldHierarchy<TScenario extends object, TFeature extends object | undefined, TRule extends object | undefined, TOutline extends object | undefined> {
|
|
13
|
+
readonly scenario: TScenario;
|
|
14
|
+
readonly feature: TFeature;
|
|
15
|
+
readonly rule: TRule;
|
|
16
|
+
readonly outline: TOutline;
|
|
17
|
+
}
|
|
18
|
+
export interface ScopePayloadMap<TScenario extends object, TFeature extends object | undefined, TRule extends object | undefined, TOutline extends object | undefined> {
|
|
19
|
+
readonly feature: {
|
|
20
|
+
feature: NonNullable<TFeature>;
|
|
21
|
+
};
|
|
22
|
+
readonly rule: {
|
|
23
|
+
feature: TFeature;
|
|
24
|
+
rule: NonNullable<TRule>;
|
|
25
|
+
};
|
|
26
|
+
readonly outline: {
|
|
27
|
+
feature: TFeature;
|
|
28
|
+
rule: TRule;
|
|
29
|
+
outline: NonNullable<TOutline>;
|
|
30
|
+
};
|
|
31
|
+
readonly scenario: {
|
|
32
|
+
feature: TFeature;
|
|
33
|
+
rule: TRule;
|
|
34
|
+
outline: TOutline;
|
|
35
|
+
scenario: TScenario;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export type ScopePayload<Scope extends WorldScope, TScenario extends object, TFeature extends object | undefined, TRule extends object | undefined, TOutline extends object | undefined> = ScopePayloadMap<TScenario, TFeature, TRule, TOutline>[Scope];
|
|
39
|
+
export interface StepRuntimeContext {
|
|
40
|
+
readonly pickle?: {
|
|
41
|
+
readonly id?: string;
|
|
42
|
+
readonly name?: string;
|
|
43
|
+
readonly uri?: string;
|
|
44
|
+
readonly astNodeIds?: string[];
|
|
45
|
+
};
|
|
46
|
+
readonly gherkinDocument?: {
|
|
47
|
+
readonly feature?: {
|
|
48
|
+
readonly name?: string;
|
|
49
|
+
readonly location?: {
|
|
50
|
+
readonly uri?: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
}
|
|
56
|
+
export interface ScopeKeyResolver<Ctx = StepRuntimeContext> {
|
|
57
|
+
feature?: (context: Ctx) => string | undefined;
|
|
58
|
+
rule?: (context: Ctx) => string | undefined;
|
|
59
|
+
outline?: (context: Ctx) => string | undefined;
|
|
60
|
+
scenario: (context: Ctx) => string;
|
|
61
|
+
}
|
|
62
|
+
export type StepExpression = string | RegExp;
|
|
63
|
+
export type StepCallback = (...args: unknown[]) => unknown | Promise<unknown>;
|
|
64
|
+
export interface StepRegistrar {
|
|
65
|
+
(expression: StepExpression, handler: StepCallback): void;
|
|
66
|
+
}
|
|
67
|
+
export interface HookCallback<Scope extends WorldScope, TScenario extends object, TFeature extends object | undefined, TRule extends object | undefined, TOutline extends object | undefined, Ctx = StepRuntimeContext> {
|
|
68
|
+
(payload: ScopePayload<Scope, TScenario, TFeature, TRule, TOutline>, context: Ctx): unknown | Promise<unknown>;
|
|
69
|
+
}
|
|
70
|
+
export interface StepDsl {
|
|
71
|
+
readonly Given: StepRegistrar;
|
|
72
|
+
readonly When: StepRegistrar;
|
|
73
|
+
readonly Then: StepRegistrar;
|
|
74
|
+
readonly And?: StepRegistrar;
|
|
75
|
+
readonly But?: StepRegistrar;
|
|
76
|
+
readonly Before?: (handler: StepCallback) => void;
|
|
77
|
+
readonly After?: (handler: StepCallback) => void;
|
|
78
|
+
readonly BeforeAll?: (handler: StepCallback) => void;
|
|
79
|
+
readonly AfterAll?: (handler: StepCallback) => void;
|
|
80
|
+
readonly defineParameterType?: (definition: ParameterTypeDefinition) => void;
|
|
81
|
+
}
|
|
82
|
+
export interface ParameterTypeDefinition {
|
|
83
|
+
readonly name: string;
|
|
84
|
+
readonly regexp: RegExp | readonly RegExp[];
|
|
85
|
+
readonly transformer: (...matches: string[]) => unknown;
|
|
86
|
+
readonly useForSnippets?: boolean;
|
|
87
|
+
readonly preferForRegexpMatch?: boolean;
|
|
88
|
+
readonly useRegexMatch?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export interface StepFactoryOptions<TFeature extends object | undefined, TRule extends object | undefined, TOutline extends object | undefined, Ctx = StepRuntimeContext> {
|
|
91
|
+
readonly feature?: WorldCtor<DefinedWorld<TFeature>>;
|
|
92
|
+
readonly rule?: WorldCtor<DefinedWorld<TRule>>;
|
|
93
|
+
readonly outline?: WorldCtor<DefinedWorld<TOutline>>;
|
|
94
|
+
readonly dsl?: StepDsl;
|
|
95
|
+
readonly expressions?: readonly ParameterTypeDefinition[];
|
|
96
|
+
readonly keyResolver?: ScopeKeyResolver<Ctx>;
|
|
97
|
+
}
|
|
98
|
+
export interface StepSuite<TScenario extends object, TFeature extends object | undefined, TRule extends object | undefined, TOutline extends object | undefined, Ctx = StepRuntimeContext> {
|
|
99
|
+
readonly Given: StepRegistrar;
|
|
100
|
+
readonly When: StepRegistrar;
|
|
101
|
+
readonly Then: StepRegistrar;
|
|
102
|
+
readonly And: StepRegistrar;
|
|
103
|
+
readonly But: StepRegistrar;
|
|
104
|
+
readonly hooks: HookSuite<TScenario, TFeature, TRule, TOutline, Ctx>;
|
|
105
|
+
readonly flow: StepFlowBuilder;
|
|
106
|
+
}
|
|
107
|
+
export interface HookSuite<TScenario extends object, TFeature extends object | undefined, TRule extends object | undefined, TOutline extends object | undefined, Ctx = StepRuntimeContext> {
|
|
108
|
+
readonly BeforeFeature: (handler: HookCallback<"feature", TScenario, TFeature, TRule, TOutline, Ctx>) => void;
|
|
109
|
+
readonly AfterFeature: (handler: HookCallback<"feature", TScenario, TFeature, TRule, TOutline, Ctx>) => void;
|
|
110
|
+
readonly BeforeRule: (handler: HookCallback<"rule", TScenario, TFeature, TRule, TOutline, Ctx>) => void;
|
|
111
|
+
readonly AfterRule: (handler: HookCallback<"rule", TScenario, TFeature, TRule, TOutline, Ctx>) => void;
|
|
112
|
+
readonly BeforeOutline: (handler: HookCallback<"outline", TScenario, TFeature, TRule, TOutline, Ctx>) => void;
|
|
113
|
+
readonly AfterOutline: (handler: HookCallback<"outline", TScenario, TFeature, TRule, TOutline, Ctx>) => void;
|
|
114
|
+
readonly BeforeScenario: (handler: HookCallback<"scenario", TScenario, TFeature, TRule, TOutline, Ctx>) => void;
|
|
115
|
+
readonly AfterScenario: (handler: HookCallback<"scenario", TScenario, TFeature, TRule, TOutline, Ctx>) => void;
|
|
116
|
+
}
|
|
117
|
+
export interface StepFlowBuilder {
|
|
118
|
+
readonly given: (expression: StepExpression) => StepFlowRunner;
|
|
119
|
+
readonly when: (expression: StepExpression) => StepFlowRunner;
|
|
120
|
+
readonly then: (expression: StepExpression) => StepFlowRunner;
|
|
121
|
+
readonly and: (expression: StepExpression) => StepFlowRunner;
|
|
122
|
+
readonly but: (expression: StepExpression) => StepFlowRunner;
|
|
123
|
+
}
|
|
124
|
+
export interface StepFlowRunner {
|
|
125
|
+
run(handler: StepCallback): StepFlowBuilder;
|
|
126
|
+
}
|
package/package.json
CHANGED
|
@@ -1,70 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autometa/app",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.0-rc.0",
|
|
4
|
+
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/index.
|
|
7
|
-
"module": "dist/
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
9
12
|
"exports": {
|
|
10
|
-
"import": "./dist/
|
|
11
|
-
"require": "./dist/index.
|
|
12
|
-
"default": "./dist/
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.cjs",
|
|
15
|
+
"default": "./dist/index.js",
|
|
13
16
|
"types": "./dist/index.d.ts"
|
|
14
17
|
},
|
|
15
18
|
"license": "MIT",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@autometa/errors": "1.0.0-rc.0",
|
|
21
|
+
"@autometa/injection": "1.0.0-rc.0"
|
|
22
|
+
},
|
|
16
23
|
"devDependencies": {
|
|
17
24
|
"@types/node": "^18.11.18",
|
|
18
|
-
"@types/uuid": "^9.0.5",
|
|
19
25
|
"@typescript-eslint/eslint-plugin": "^5.54.1",
|
|
20
26
|
"@typescript-eslint/parser": "^5.54.1",
|
|
21
|
-
"@vitest/coverage-istanbul": "^1.4.0",
|
|
22
|
-
"@vitest/coverage-v8": "^1.4.0",
|
|
23
|
-
"asserters": "link:packages/asserters",
|
|
24
|
-
"autometa": "link:packages/autometa",
|
|
25
|
-
"config": "link:packages/config",
|
|
26
|
-
"coordinator": "link:packages/coordinator",
|
|
27
|
-
"cucumber-expressions": "link:packages/cucumber-expressions",
|
|
28
|
-
"datetime": "link:packages/datetime",
|
|
29
|
-
"errors": "link:packages/errors",
|
|
30
27
|
"eslint": "^8.37.0",
|
|
31
28
|
"eslint-config-prettier": "^8.3.0",
|
|
32
|
-
"events": "link:packages/events",
|
|
33
|
-
"gherkin": "link:packages/gherkin",
|
|
34
|
-
"istanbul": "^0.4.5",
|
|
35
|
-
"jest-executor": "link:packages/jest-executor",
|
|
36
|
-
"jest-transformer": "link:packages/jest-transformer",
|
|
37
|
-
"phrases": "link:packages/phrases",
|
|
38
|
-
"reflect-metadata": "^0.1.13",
|
|
39
29
|
"rimraf": "^4.1.2",
|
|
40
|
-
"scopes": "link:packages/scopes",
|
|
41
|
-
"test-builder": "link:packages/test-builder",
|
|
42
|
-
"test-executor": "link:packages/test-executor",
|
|
43
30
|
"tsup": "^7.2.0",
|
|
44
|
-
"types": "link:packages/types",
|
|
45
31
|
"typescript": "^4.9.5",
|
|
46
32
|
"vitest": "1.4.0",
|
|
47
33
|
"eslint-config-custom": "0.6.0",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
},
|
|
51
|
-
"dependencies": {
|
|
52
|
-
"tsyringe": "^4.8.0",
|
|
53
|
-
"uuid": "^9.0.1",
|
|
54
|
-
"@autometa/errors": "0.2.2",
|
|
55
|
-
"@autometa/asserters": "0.1.8",
|
|
56
|
-
"@autometa/fixture-proxies": "^0.1.3",
|
|
57
|
-
"@autometa/injection": "^0.1.5",
|
|
58
|
-
"@autometa/phrases": "0.1.12"
|
|
34
|
+
"tsconfig": "0.7.0",
|
|
35
|
+
"tsup-config": "0.1.0"
|
|
59
36
|
},
|
|
60
37
|
"scripts": {
|
|
38
|
+
"type-check": "tsc --noEmit -p tsconfig.dev.json",
|
|
39
|
+
"type-check:watch": "tsc --noEmit --watch -p tsconfig.dev.json",
|
|
40
|
+
"build": "tsup && pnpm run build:types",
|
|
41
|
+
"build:types": "rimraf tsconfig.types.tsbuildinfo && tsc --build tsconfig.types.json",
|
|
42
|
+
"build:watch": "tsup --watch",
|
|
43
|
+
"dev": "tsup --watch",
|
|
61
44
|
"test": "vitest run --passWithNoTests",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
45
|
+
"test:watch": "vitest --passWithNoTests",
|
|
46
|
+
"test:ui": "vitest --ui --passWithNoTests",
|
|
47
|
+
"coverage": "vitest run --coverage --passWithNoTests",
|
|
64
48
|
"lint": "eslint . --max-warnings 0",
|
|
65
49
|
"lint:fix": "eslint . --fix",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"build:watch": "tsup --watch"
|
|
50
|
+
"prettify": "prettier --config .prettierrc 'src/**/*.ts' --write",
|
|
51
|
+
"clean": "rimraf dist"
|
|
69
52
|
}
|
|
70
53
|
}
|
package/.eslintignore
DELETED
package/.eslintrc.cjs
DELETED
package/.turbo/turbo-build.log
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @autometa/app@0.0.0 build /Users/ben.aherne/Documents/GitHub/autometa/packages/app
|
|
3
|
-
> tsup
|
|
4
|
-
|
|
5
|
-
CLI Building entry: src/index.ts
|
|
6
|
-
CLI Using tsconfig: tsconfig.json
|
|
7
|
-
CLI tsup v6.7.0
|
|
8
|
-
CLI Using tsup config: /Users/ben.aherne/Documents/GitHub/autometa/packages/app/tsup.config.ts
|
|
9
|
-
CLI Target: es2020
|
|
10
|
-
CLI Cleaning output folder
|
|
11
|
-
CJS Build start
|
|
12
|
-
ESM Build start
|
|
13
|
-
CJS You have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin
|
|
14
|
-
ESM You have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin
|
|
15
|
-
ESM dist/esm/index.js 1.18 KB
|
|
16
|
-
ESM ⚡️ Build success in 9ms
|
|
17
|
-
CJS dist/index.js 2.43 KB
|
|
18
|
-
CJS ⚡️ Build success in 9ms
|
|
19
|
-
DTS Build start
|
|
20
|
-
DTS ⚡️ Build success in 599ms
|
|
21
|
-
DTS dist/index.d.ts 1.59 KB
|
package/.turbo/turbo-clean.log
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @autometa/app@0.1.1 coverage /Users/ben.aherne/Documents/GitHub/autometa/packages/app
|
|
3
|
-
> vitest run --coverage
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
RUN v0.33.0 /Users/ben.aherne/Documents/GitHub/autometa/packages/app
|
|
7
|
-
Coverage enabled with istanbul
|
|
8
|
-
|
|
9
|
-
✓ src/decorators/fixture.spec.ts (2 tests) 3ms
|
|
10
|
-
|
|
11
|
-
Test Files 1 passed (1)
|
|
12
|
-
Tests 2 passed (2)
|
|
13
|
-
Start at 16:39:00
|
|
14
|
-
Duration 1.78s (transform 295ms, setup 0ms, collect 423ms, tests 3ms, environment 0ms, prepare 511ms)
|
|
15
|
-
|
|
16
|
-
% Coverage report from istanbul
|
|
17
|
-
------------|---------|----------|---------|---------|-------------------
|
|
18
|
-
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
19
|
-
------------|---------|----------|---------|---------|-------------------
|
|
20
|
-
All files | 66.66 | 75 | 50 | 66.66 |
|
|
21
|
-
fixture.ts | 66.66 | 75 | 50 | 66.66 | 50-52
|
|
22
|
-
------------|---------|----------|---------|---------|-------------------
|
package/.turbo/turbo-lint.log
DELETED
|
File without changes
|
package/.turbo/turbo-test.log
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @autometa/app@0.3.5 test /Users/ben.aherne/Documents/GitHub/autometa/packages/app
|
|
3
|
-
> vitest run --passWithNoTests
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
RUN v1.4.0 /Users/ben.aherne/Documents/GitHub/autometa/packages/app
|
|
7
|
-
|
|
8
|
-
include: **/*.{test,spec}.?(c|m)[jt]s?(x)
|
|
9
|
-
No test files found, exiting with code 0
|
|
10
|
-
exclude: **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**, **/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*
|
|
11
|
-
|
|
12
|
-
watch exclude: **/node_modules/**, **/dist/**
|