@ripplo/testing 0.3.7 → 0.3.8

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 CHANGED
@@ -440,7 +440,7 @@ For entire presentation-only flows, pass the flag to `test`:
440
440
  test("filter-sort-user-flows", { uiOnly: true }).name("Filter & sort");
441
441
  ```
442
442
 
443
- Treat `uiOnly` as a narrow escape hatchdefault to writing an observer.
443
+ `uiOnly: true` is only valid for steps with zero backend effect (pure view transitions). If the step triggers a mutation, background job, or optimistic UI update, `uiOnly` is wrong — write an observer. The `mutation-without-observer-coverage` lint rule is a backstop, not a ceiling: authoring a test without backend assertions on a mutation flow is a mistake regardless of whether lint catches this particular click label. **Never use `uiOnly: true` with a `// TODO: add observer` comment as a placeholder.** That's a false green the observer is in-scope work, not follow-up.
444
444
 
445
445
  ## Determinism Rules
446
446
 
package/dist/assert.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { O as ObserverHandle, a as ObserverInput, b as ObserverBudgetTier } from './types-Degkxs1f.js';
1
+ import { O as ObserverHandle, a as ObserverInput, b as ObserverBudgetTier } from './types-Do4o4Y_c.js';
2
2
  import { Variable, StaticStringRef, VariableRef } from './control.js';
3
3
  import { U as UnlabeledStep } from './step-De52hTLd.js';
4
4
  import { CheckLocator, AnyLocator } from './locators.js';
package/dist/assert.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readObserverBudget,
3
3
  readObserverName
4
- } from "./chunk-XBYG5NBY.js";
4
+ } from "./chunk-D7DRM7AG.js";
5
5
  import {
6
6
  toSpecLocator,
7
7
  toStringValueRef
@@ -1,4 +1,4 @@
1
- import { O as ObserverHandle, P as Precondition, l as PreconditionData, j as TestDefinition, e as DslConfig, g as ObserverDefinition, k as PreconditionDefinition, U as UnimplementedItems, f as ObserverContext, h as ObserverOutcome, S as SetupContext, m as TestValue, T as TeardownContext, n as UserDslConfig } from './types-Degkxs1f.js';
1
+ import { O as ObserverHandle, P as Precondition, l as PreconditionData, j as TestDefinition, e as DslConfig, g as ObserverDefinition, k as PreconditionDefinition, U as UnimplementedItems, f as ObserverContext, h as ObserverOutcome, S as SetupContext, m as TestValue, T as TeardownContext, n as UserDslConfig } from './types-Do4o4Y_c.js';
2
2
  import { ObserverBudget } from '@ripplo/spec';
3
3
  import { S as Step } from './step-De52hTLd.js';
4
4
 
@@ -43,7 +43,10 @@ interface TestNeedsStartsAt<TVars extends Record<string, Record<string, string>>
43
43
  readonly startsAt: (fn: (vars: TVars) => string) => TestNeedsSteps<TVars>;
44
44
  }
45
45
  interface TestNeedsSteps<TVars extends Record<string, Record<string, string>>> {
46
- readonly steps: (fn: (vars: TVars) => ReadonlyArray<Step>) => TestDefinition;
46
+ readonly steps: (fn: (vars: TVars) => ReadonlyArray<Step>) => TestNeedsCoverage;
47
+ }
48
+ interface TestNeedsCoverage {
49
+ readonly coverage: (...ids: ReadonlyArray<string>) => TestDefinition;
47
50
  }
48
51
 
49
52
  type PreconditionSetupResult<TData extends Record<string, string>> = {
@@ -54,6 +54,7 @@ function compileTest(def, preconditionDefs) {
54
54
  const resolvedPreconditions = resolveDependencyChain(def.requires, preconditionDefs);
55
55
  return {
56
56
  additionalChecks: [],
57
+ coverage: def.coverage,
57
58
  description: def.description,
58
59
  expectedOutcome: def.expectedOutcome,
59
60
  implemented: def.implemented,
@@ -45,6 +45,9 @@ var DEFAULT_IGNORE_PATHS = [
45
45
  "**/storybook-static/**",
46
46
  "**/*.stories.*",
47
47
  "**/*.story.*",
48
+ "**/cli/**",
49
+ "**/scripts/**",
50
+ "**/tools/**",
48
51
  "**/__tests__/**",
49
52
  "**/__mocks__/**",
50
53
  "**/__fixtures__/**",
@@ -1,6 +1,6 @@
1
1
  import { Observer, Precondition, WorkflowSpec } from '@ripplo/spec';
2
- import { d as RipploBuilder } from './builder-BGr5JvrY.js';
3
- import { e as DslConfig } from './types-Degkxs1f.js';
2
+ import { d as RipploBuilder } from './builder-D-i_ueN3.js';
3
+ import { e as DslConfig } from './types-Do4o4Y_c.js';
4
4
  import './step-De52hTLd.js';
5
5
  import 'zod';
6
6
 
@@ -12,6 +12,7 @@ interface CompileResult {
12
12
  }
13
13
  interface CompiledTest {
14
14
  readonly additionalChecks: ReadonlyArray<string>;
15
+ readonly coverage: ReadonlyArray<string>;
15
16
  readonly description: string;
16
17
  readonly expectedOutcome: string;
17
18
  readonly implemented: boolean;
package/dist/compiler.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  compile
3
- } from "./chunk-KNF4K4JH.js";
3
+ } from "./chunk-5AGV4KQA.js";
4
4
  import "./chunk-MGATMMCZ.js";
5
5
  import "./chunk-4MGIQFAJ.js";
6
6
  export {
package/dist/elysia.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Elysia } from 'elysia';
2
- import { R as RipploEngine } from './engine-CZ4F_Csu.js';
3
- import './builder-BGr5JvrY.js';
4
- import './types-Degkxs1f.js';
2
+ import { R as RipploEngine } from './engine-BMfNkIKC.js';
3
+ import './builder-D-i_ueN3.js';
4
+ import './types-Do4o4Y_c.js';
5
5
  import 'zod';
6
6
  import './step-De52hTLd.js';
7
7
  import '@ripplo/spec';
@@ -1,5 +1,5 @@
1
- import { c as PreconditionRegistry, a as ObserverRegistry, O as ObserverImplFn, P as PreconditionImpl, e as RipploInstance } from './builder-BGr5JvrY.js';
2
- import { h as ObserverOutcome, C as CookieEntry, e as DslConfig, g as ObserverDefinition, k as PreconditionDefinition, U as UnimplementedItems, O as ObserverHandle, P as Precondition } from './types-Degkxs1f.js';
1
+ import { c as PreconditionRegistry, a as ObserverRegistry, O as ObserverImplFn, P as PreconditionImpl, e as RipploInstance } from './builder-D-i_ueN3.js';
2
+ import { h as ObserverOutcome, C as CookieEntry, e as DslConfig, g as ObserverDefinition, k as PreconditionDefinition, U as UnimplementedItems, O as ObserverHandle, P as Precondition } from './types-Do4o4Y_c.js';
3
3
 
4
4
  interface EngineResult {
5
5
  readonly cookies: ReadonlyArray<CookieEntry>;
package/dist/express.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Router } from 'express';
2
- import { R as RipploEngine } from './engine-CZ4F_Csu.js';
3
- import './builder-BGr5JvrY.js';
4
- import './types-Degkxs1f.js';
2
+ import { R as RipploEngine } from './engine-BMfNkIKC.js';
3
+ import './builder-D-i_ueN3.js';
4
+ import './types-Do4o4Y_c.js';
5
5
  import 'zod';
6
6
  import './step-De52hTLd.js';
7
7
  import '@ripplo/spec';
package/dist/fastify.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { FastifyInstance } from 'fastify';
2
- import { R as RipploEngine } from './engine-CZ4F_Csu.js';
3
- import './builder-BGr5JvrY.js';
4
- import './types-Degkxs1f.js';
2
+ import { R as RipploEngine } from './engine-BMfNkIKC.js';
3
+ import './builder-D-i_ueN3.js';
4
+ import './types-Do4o4Y_c.js';
5
5
  import 'zod';
6
6
  import './step-De52hTLd.js';
7
7
  import '@ripplo/spec';
package/dist/hono.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Hono } from 'hono';
2
- import { R as RipploEngine } from './engine-CZ4F_Csu.js';
3
- import './builder-BGr5JvrY.js';
4
- import './types-Degkxs1f.js';
2
+ import { R as RipploEngine } from './engine-BMfNkIKC.js';
3
+ import './builder-D-i_ueN3.js';
4
+ import './types-Do4o4Y_c.js';
5
5
  import 'zod';
6
6
  import './step-De52hTLd.js';
7
7
  import '@ripplo/spec';
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { O as ObserverImplFn, a as ObserverRegistry, P as PreconditionImpl, b as PreconditionRecord, c as PreconditionRegistry, R as ResolveDeps, d as RipploBuilder, e as RipploInstance, f as RipploRegistries, g as createRipplo, o as observer, p as precondition, t as test } from './builder-BGr5JvrY.js';
1
+ export { O as ObserverImplFn, a as ObserverRegistry, P as PreconditionImpl, b as PreconditionRecord, c as PreconditionRegistry, R as ResolveDeps, d as RipploBuilder, e as RipploInstance, f as RipploRegistries, g as createRipplo, o as observer, p as precondition, t as test } from './builder-D-i_ueN3.js';
2
2
  import { CompileResult } from './compiler.js';
3
3
  export { CompiledTest, compile } from './compiler.js';
4
- export { E as EngineImpls, a as EngineResult, b as ExecuteBatchOptions, N as NotImplemented, O as ObserverImplFnFor, P as PreconditionImplFor, R as RipploEngine, c as createEngine, n as notImplemented } from './engine-CZ4F_Csu.js';
5
- import { C as CookieEntry } from './types-Degkxs1f.js';
6
- export { c as CookieOptions, D as DEFAULT_IGNORE_PATHS, d as DEFAULT_WATCH_PATHS, e as DslConfig, f as ObserverContext, g as ObserverDefinition, O as ObserverHandle, a as ObserverInput, h as ObserverOutcome, P as Precondition, i as PreconditionDeps, S as SetupContext, T as TeardownContext, j as TestDefinition } from './types-Degkxs1f.js';
4
+ export { E as EngineImpls, a as EngineResult, b as ExecuteBatchOptions, N as NotImplemented, O as ObserverImplFnFor, P as PreconditionImplFor, R as RipploEngine, c as createEngine, n as notImplemented } from './engine-BMfNkIKC.js';
5
+ import { C as CookieEntry } from './types-Do4o4Y_c.js';
6
+ export { c as CookieOptions, D as DEFAULT_IGNORE_PATHS, d as DEFAULT_WATCH_PATHS, e as DslConfig, f as ObserverContext, g as ObserverDefinition, O as ObserverHandle, a as ObserverInput, h as ObserverOutcome, P as Precondition, i as PreconditionDeps, S as SetupContext, T as TeardownContext, j as TestDefinition } from './types-Do4o4Y_c.js';
7
7
  export { D as DslNodeInput } from './step-De52hTLd.js';
8
8
  import '@ripplo/spec';
9
9
  import 'zod';
package/dist/index.js CHANGED
@@ -12,10 +12,10 @@ import {
12
12
  readPreconditionName,
13
13
  readTestValue,
14
14
  userDslConfigSchema
15
- } from "./chunk-XBYG5NBY.js";
15
+ } from "./chunk-D7DRM7AG.js";
16
16
  import {
17
17
  compile
18
- } from "./chunk-KNF4K4JH.js";
18
+ } from "./chunk-5AGV4KQA.js";
19
19
  import "./chunk-MGATMMCZ.js";
20
20
  import {
21
21
  buildSetCookieHeader,
@@ -260,6 +260,7 @@ function buildTestStartsAt({
260
260
  }) {
261
261
  return {
262
262
  notImplemented: () => ({
263
+ coverage: [],
263
264
  description,
264
265
  expectedOutcome,
265
266
  id,
@@ -297,16 +298,19 @@ function buildTestSteps({
297
298
  }) {
298
299
  return {
299
300
  steps: (stepsFn) => ({
300
- description,
301
- expectedOutcome,
302
- id,
303
- implemented: true,
304
- name,
305
- requires: [...reqNames],
306
- requiresKeys,
307
- startsAtFn,
308
- stepsFn,
309
- uiOnly
301
+ coverage: (...ids) => ({
302
+ coverage: ids,
303
+ description,
304
+ expectedOutcome,
305
+ id,
306
+ implemented: true,
307
+ name,
308
+ requires: [...reqNames],
309
+ requiresKeys,
310
+ startsAtFn,
311
+ stepsFn,
312
+ uiOnly
313
+ })
310
314
  })
311
315
  };
312
316
  }
package/dist/koa.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Middleware } from 'koa';
2
- import { R as RipploEngine } from './engine-CZ4F_Csu.js';
3
- import './builder-BGr5JvrY.js';
4
- import './types-Degkxs1f.js';
2
+ import { R as RipploEngine } from './engine-BMfNkIKC.js';
3
+ import './builder-D-i_ueN3.js';
4
+ import './types-Do4o4Y_c.js';
5
5
  import 'zod';
6
6
  import './step-De52hTLd.js';
7
7
  import '@ripplo/spec';
@@ -1,8 +1,8 @@
1
1
  import { Codec } from '@ripplo/spec';
2
2
  import { z } from 'zod';
3
3
  import { CompileResult } from './compiler.js';
4
- import './builder-BGr5JvrY.js';
5
- import './types-Degkxs1f.js';
4
+ import './builder-D-i_ueN3.js';
5
+ import './types-Do4o4Y_c.js';
6
6
  import './step-De52hTLd.js';
7
7
 
8
8
  declare const LOCKFILE_RELATIVE_PATH = ".ripplo/ripplo.lock";
@@ -21,6 +21,7 @@ declare const lockfileBodySchema: z.ZodObject<{
21
21
  returns: z.ZodOptional<z.ZodArray<z.ZodString>>;
22
22
  }, z.core.$strip>>;
23
23
  tests: z.ZodArray<z.ZodObject<{
24
+ coverage: z.ZodDefault<z.ZodArray<z.ZodString>>;
24
25
  expectedOutcome: z.ZodString;
25
26
  name: z.ZodString;
26
27
  preconditions: z.ZodArray<z.ZodString>;
package/dist/lockfile.js CHANGED
@@ -496,6 +496,7 @@ var LOCKFILE_RELATIVE_PATH = ".ripplo/ripplo.lock";
496
496
  var MAX_TESTS = 5e3;
497
497
  var requiresKeysSchema = z10.record(z10.string().max(200), z10.string().max(200));
498
498
  var compiledTestSchema = z10.object({
499
+ coverage: z10.array(z10.string().max(500)).max(2e3).default([]),
499
500
  expectedOutcome: z10.string().max(2e3),
500
501
  name: z10.string().max(200),
501
502
  preconditions: z10.array(z10.string().max(200)).max(1e3),
@@ -514,6 +515,7 @@ function compileResultToLockfile(result) {
514
515
  observers: result.observers,
515
516
  preconditions: result.preconditions,
516
517
  tests: result.tests.filter((test) => test.implemented).map((test) => ({
518
+ coverage: [...test.coverage],
517
519
  expectedOutcome: test.expectedOutcome,
518
520
  name: test.name,
519
521
  preconditions: [...test.preconditions],
package/dist/nestjs.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { DynamicModule } from '@nestjs/common';
2
- import { R as RipploEngine } from './engine-CZ4F_Csu.js';
3
- import './builder-BGr5JvrY.js';
4
- import './types-Degkxs1f.js';
2
+ import { R as RipploEngine } from './engine-BMfNkIKC.js';
3
+ import './builder-D-i_ueN3.js';
4
+ import './types-Do4o4Y_c.js';
5
5
  import 'zod';
6
6
  import './step-De52hTLd.js';
7
7
  import '@ripplo/spec';
package/dist/nextjs.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { R as RipploEngine } from './engine-CZ4F_Csu.js';
2
- import './builder-BGr5JvrY.js';
3
- import './types-Degkxs1f.js';
1
+ import { R as RipploEngine } from './engine-BMfNkIKC.js';
2
+ import './builder-D-i_ueN3.js';
3
+ import './types-Do4o4Y_c.js';
4
4
  import 'zod';
5
5
  import './step-De52hTLd.js';
6
6
  import '@ripplo/spec';
@@ -70,6 +70,7 @@ interface PreconditionDefinition {
70
70
  }
71
71
  type VarsFn<T> = (vars: Record<string, Record<string, string>>) => T;
72
72
  interface TestDefinition {
73
+ readonly coverage: ReadonlyArray<string>;
73
74
  readonly description: string;
74
75
  readonly expectedOutcome: string;
75
76
  readonly id: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ripplo/testing",
3
3
  "description": "TypeScript DSL for defining and running Ripplo e2e workflow tests",
4
- "version": "0.3.7",
4
+ "version": "0.3.8",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -99,8 +99,8 @@
99
99
  "tsup": "^8.5.1",
100
100
  "typescript": "catalog:",
101
101
  "vitest": "^4.1.4",
102
- "@ripplo/eslint-config": "0.0.0",
103
- "@ripplo/spec": "^0.0.0"
102
+ "@ripplo/spec": "^0.0.0",
103
+ "@ripplo/eslint-config": "0.0.0"
104
104
  },
105
105
  "peerDependencies": {
106
106
  "@nestjs/common": "^10.0.0 || ^11.0.0",