@systemfsoftware/effect-spec-runtime 1.1.5 → 1.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @systemfsoftware/effect-spec-runtime
2
2
 
3
- # @systemfsoftware/effect-spec-runtime@1.1.5
3
+ # @systemfsoftware/effect-spec-runtime@1.2.0
4
4
 
5
- Published declaration files no longer carry the rolldown-plugin-dts patch; they come from rolldown-plugin-dts 0.28.8, which includes the same fix upstream.
5
+ A live scenario can name the pipeline its second run executes: `scenario(title, { live: reason, rerun: pipeline }, firstPipeline)`. Every passing case runs again on fresh services to find state kept outside its layer, so a live scenario whose first run waits on an act that happens once, such as a person approving a sign-in in a browser, would ask for that act a second time. With `rerun` the second run executes the given pipeline over the same layers instead, and that check still runs. The runtime's `RegisterFn` accepts the rerun scenario through the new `CaseLive` type.
package/dist/index.d.ts CHANGED
@@ -42,7 +42,7 @@ declare const exploreOnce: <A, E>(program: Effect.Effect<A, E>) => Promise<void>
42
42
  type RegisterMode = 'run' | 'skip' | 'only';
43
43
  type DescribeMode = 'describe' | 'skip' | 'only';
44
44
  declare namespace Suite_d_exports {
45
- export { Bindings, Config$1 as Config, DescribeMode, LiveCase, Options, RegisterFn, RegisterMode, Scenario, Shared, open, openCase, openShared, openSharedCase };
45
+ export { Bindings, CaseLive, Config$1 as Config, DescribeMode, LiveCase, Options, RegisterFn, RegisterMode, Scenario, Shared, open, openCase, openShared, openSharedCase };
46
46
  }
47
47
  type Options = Pick<TestOptions, 'tags'> & Partial<TestOptions>;
48
48
  interface Bindings {
@@ -63,8 +63,16 @@ interface Shared<R> {
63
63
  * provides; every marked step needs the runner's scope and check service beside it.
64
64
  */
65
65
  type Scenario<B, E, R> = (expect: Expect) => Effect.Effect<B, E, R | Scope.Scope | Asserted>;
66
+ /**
67
+ * A case's own live declaration. A live case's first run may hang on an act that happens once, such
68
+ * as a person approving in a browser; `rerun` is then the scenario the second run on fresh services
69
+ * executes instead, so the check for state kept outside the layer still runs without that act.
70
+ */
71
+ interface CaseLive<B, E, R> extends LiveCase {
72
+ readonly rerun?: Scenario<B, E, R>;
73
+ }
66
74
  interface RegisterFn<B, E, R> {
67
- (name: string, scenario: Scenario<B, E, R>, mode: RegisterMode, live?: LiveCase): void;
75
+ (name: string, scenario: Scenario<B, E, R>, mode: RegisterMode, live?: CaseLive<B, E, R>): void;
68
76
  }
69
77
  declare const open: {
70
78
  <B, E, C>(config: Config$1, use: (register: RegisterFn<B, E, Scope.Scope>, propIt: Vitest.MethodsNonLive<never>) => C): (bindings: Bindings) => void;
package/dist/index.mjs CHANGED
@@ -295,6 +295,14 @@ const caseBody = (scenario, env, live, explorer) => function* ({ expect }) {
295
295
  }
296
296
  yield* program;
297
297
  };
298
+ const registerLiveCase = (register, name, scenario, env, live) => {
299
+ const first = caseBody(scenario, env, live, exploredProgram);
300
+ if (live.rerun === void 0) {
301
+ register(name, first);
302
+ return;
303
+ }
304
+ register(name, first, { rerun: caseBody(live.rerun, env, live, exploredProgram) });
305
+ };
298
306
  const registerCase = (register, name, scenario, env, live) => {
299
307
  if (live === void 0) {
300
308
  register(name, caseBody(scenario, env, live, exploredProgram), {
@@ -303,7 +311,7 @@ const registerCase = (register, name, scenario, env, live) => {
303
311
  });
304
312
  return;
305
313
  }
306
- register(name, caseBody(scenario, env, live, exploredProgram));
314
+ registerLiveCase(register, name, scenario, env, live);
307
315
  };
308
316
  const registrarFor = (methodsIt, config, env) => (name, scenario, mode, caseLive) => {
309
317
  const live = caseLive ?? config.live;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@systemfsoftware/effect-spec-runtime",
3
3
  "license": "Apache-2.0",
4
- "version": "1.1.5",
4
+ "version": "1.2.0",
5
5
  "author": "Ryan Lee <drdgvhbh@gmail.com>",
6
6
  "repository": {
7
7
  "type": "git",
@@ -37,22 +37,22 @@
37
37
  "devDependencies": {
38
38
  "@microsoft/api-extractor": "^7.59.4",
39
39
  "@systemfsoftware/arethetypeswrong-cli": "^4.2.0",
40
- "@systemfsoftware/oxlint-config-recommended": "^6.0.1",
40
+ "@systemfsoftware/oxlint-config-recommended": "^7.0.0",
41
41
  "@systemfsoftware/tsconfig": "^2.1.0",
42
42
  "@systemfsoftware/tsdown-config": "^0.1.2",
43
- "@systemfsoftware/vitest": "^4.1.1",
43
+ "@systemfsoftware/vitest": "^4.1.2",
44
44
  "@systemfsoftware/vitest-config": "^0.1.3",
45
45
  "@types/node": "^26.6.5",
46
46
  "effect": "^4.1.2",
47
47
  "fast-check": "^4.10.2",
48
- "oxlint": "~1.89.0",
48
+ "oxlint": "~1.93.0",
49
49
  "rimraf": "^6.1.3",
50
50
  "tsdown": "^0.23.0",
51
51
  "tstyche": "^7.2.5",
52
52
  "vitest": "^5.1.0"
53
53
  },
54
54
  "peerDependencies": {
55
- "@systemfsoftware/vitest": "^4.1.1",
55
+ "@systemfsoftware/vitest": "^4.1.2",
56
56
  "effect": "^4.1.2",
57
57
  "vitest": "^5.1.0"
58
58
  },