@systemfsoftware/vitest 2.0.0 → 4.1.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/CHANGELOG.md +3 -59
- package/README.md +17 -1
- package/dist/{checks-DiuzHhQM.d.ts → checks-BHOX6fGC.d.ts} +2 -2
- package/dist/{engine-D7Q6-BxD.d.ts → engine-CYGdHvr8.d.ts} +68 -107
- package/dist/{failure-nvq5TwWX.mjs → failure-B094O43o.mjs} +189 -47
- package/dist/failure.d.ts +2 -2
- package/dist/failure.mjs +2 -2
- package/dist/{guard-BocOhXt2.mjs → guard-Ci0TyBYv.mjs} +18 -6
- package/dist/guard.mjs +2 -2
- package/dist/index.d.ts +20 -70
- package/dist/index.mjs +25 -76
- package/dist/integration.d.ts +1 -1
- package/dist/integration.mjs +1 -1
- package/dist/property-defaults.d.ts +11 -0
- package/dist/property-defaults.mjs +15 -0
- package/dist/{test-context-D_-acRSc.mjs → test-context-DelFkLBL.mjs} +10 -6
- package/dist/tiers-W0BWq1uh.mjs +36 -0
- package/package.json +16 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,63 +1,7 @@
|
|
|
1
1
|
# @systemfsoftware/vitest
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# @systemfsoftware/vitest@4.1.2
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The recommended config now turns on every @effect/tsgo preset (correctness, recommended, strict, style, effect-native, antipattern and maintainers) at error, on @effect/tsgo 0.69.0 with oxlint 1.93.0 and oxlint-tsgolint 7.0.2006. The rules that still have findings in this repo are listed by name, each with its finding count, and stay off until the PR that fixes its findings removes it from the list. A consumer that upgrades may see findings from rules it has never run. The rules run on the consumer's own Effect-patched tsgolint, so @effect/tsgo is now a peer dependency: a consumer must move @effect/tsgo to ^0.69.0, oxlint to ~1.93.0 and oxlint-tsgolint to 7.0.2006 in the same change, and rerun `effect-tsgo patch --oxlint`. An older patched binary refuses the config with `Rule '<name>' not found in plugin 'effecttsgo'`.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- To keep one literal seed, set `arbitrary: { seed }` on the property.
|
|
10
|
-
- Commit `__property_seeds__` files; a case that must always run belongs in the test source.
|
|
11
|
-
- Catch a self-model law as `SelfModelLaw`, no longer `VacuousProperty`.
|
|
12
|
-
|
|
13
|
-
## 1.0.0
|
|
14
|
-
|
|
15
|
-
### Major Changes
|
|
16
|
-
|
|
17
|
-
- Require `effect` `^4` (stable 4.0.0). Release candidates are no longer supported: imports follow 4.0.0's module layout (`effect/http`, `effect/rpc`, `effect/http-api`, `effect/cluster`, `effect/process`, `effect/socket`, `effect/persistence`, `effect/reactivity`, `effect/encoding`, `effect/Arbitrary`), which does not exist in any 4.0.0 RC.
|
|
18
|
-
|
|
19
|
-
## 0.3.0
|
|
20
|
-
|
|
21
|
-
### Minor Changes
|
|
22
|
-
|
|
23
|
-
- `@systemfsoftware/vitest/failure` exports `Replay`, the `ReplayFromText` codec for `CONFORMANCE_REPLAY` text (`seed=<n>;path=<steps>`), and `replayOfText`, which reads that text or throws. `ReplayValue.path` is now `ReadonlyArray<number>`, and `providedWorkspaceRoot()` returns a branded `WorkspaceRoot`.
|
|
24
|
-
|
|
25
|
-
## 0.2.0
|
|
26
|
-
|
|
27
|
-
### Minor Changes
|
|
28
|
-
|
|
29
|
-
- Tests take `expect` from the test callback and yield each check: `it(name, function* ({ expect }) { yield* expect(actual).toEqual(expected) })`. The package stops exporting `expect`, `assert` and the `utils` helpers. With its `guard` entry listed in `setupFiles`, an `expect` imported from Vitest, or a test registered through Vitest's own `it`, is refused. Also refused, each with its rewrite as the message: a second check on one observed state, an unyielded check, a body with no check, a non-generator body, `it.effect`/`it.scoped`/`it.scopedLive`, `beforeEach`/`afterEach`, and weak matchers such as `toHaveLength`, `toBeDefined`, snapshots, `expect.anything`, `expect.soft`/`expect.poll` and argument-less `toThrow`. Libraries that judge inside a test import `step`, `captureRunBinding` and the `Check`/`Expect`/`Asserted` types from the `integration` entry.
|
|
30
|
-
|
|
31
|
-
- `@systemfsoftware/differential-spec` depends on and imports `@systemfsoftware/vitest` by its own name instead of through an `@effect/vitest` alias. `@systemfsoftware/oxlint-config-recommended` enables the test-discipline rule under its new id `vitest-from-systemfsoftware-vitest`. `@systemfsoftware/vitest` documentation examples import from `@systemfsoftware/vitest`.
|
|
32
|
-
|
|
33
|
-
The lawful runner is published under its own name, `@systemfsoftware/vitest`, starting at `0.1.0`, so peers declared as `^0.1.0` accept its patch releases.
|
|
34
|
-
|
|
35
|
-
- A failing test now reports one failure record instead of a raw cause: the error with its message, the first source line outside the spec libraries, the steps that ran and the cell decisions each caused, and a rerun command for that one scenario. Every cause in the chain keeps all lines of its message. A replay value is printed only for a run a seed or a property chose. Each failure prints once; other errors in the same cause are logged. A failed `expect` points at the line that called it and a property failure at the line that declared it. A new `@systemfsoftware/vitest/failure` entry exports the renderer, the recorder, the cause summary (`summaryOf`) and the author call-site capture (`callSite`, `callFrameOutside`, `withRaisingFrame`) for libraries that raise their own failures.
|
|
36
|
-
|
|
37
|
-
- Kernel runs are serialized. A run started while another is live now waits behind it, in arrival order, instead of failing: two runs never interleave, so a scenario never sees another run's decisions, and a suite whose cases drive the kernel can run its tests concurrently.
|
|
38
|
-
|
|
39
|
-
`@systemfsoftware/vitest` adds `captureRunBinding`, the running test's run binding. `bind(effect)` re-provides it to an effect a library runs on a runtime of its own — its own scheduler, a worker, a simulation kernel — so the checks inside it count as that test's assertions, report softly, and see the same `owned` regions.
|
|
40
|
-
|
|
41
|
-
`@systemfsoftware/effect-spec-runtime` runs a case that declares no live reason through that runner, and a case's annotations now reach the test's report.
|
|
42
|
-
|
|
43
|
-
## 0.1.0
|
|
44
|
-
|
|
45
|
-
### Minor Changes
|
|
46
|
-
|
|
47
|
-
- Tests take `expect` from the test callback and yield each check: `it(name, function* ({ expect }) { yield* expect(actual).toEqual(expected) })`. The package stops exporting `expect`, `assert` and the `utils` helpers. With its `guard` entry listed in `setupFiles`, an `expect` imported from Vitest, or a test registered through Vitest's own `it`, is refused. Also refused, each with its rewrite as the message: a second check on one observed state, an unyielded check, a body with no check, a non-generator body, `it.effect`/`it.scoped`/`it.scopedLive`, `beforeEach`/`afterEach`, and weak matchers such as `toHaveLength`, `toBeDefined`, snapshots, `expect.anything`, `expect.soft`/`expect.poll` and argument-less `toThrow`. Libraries that judge inside a test import `step`, `captureRunBinding` and the `Check`/`Expect`/`Asserted` types from the `integration` entry.
|
|
48
|
-
|
|
49
|
-
## 0.0.0
|
|
50
|
-
|
|
51
|
-
### Minor Changes
|
|
52
|
-
|
|
53
|
-
- New `captureRunBinding`: an Effect that captures the running test's binding, so a testing library can run an effect elsewhere (e.g. inside a simulation kernel) and still have its `expect` calls counted as that test's assertions.
|
|
54
|
-
|
|
55
|
-
- `@systemfsoftware/differential-spec` depends on and imports `@systemfsoftware/vitest` by its own name instead of through an `@effect/vitest` alias. `@systemfsoftware/oxlint-config-recommended` enables the test-discipline rule under its new id `vitest-from-systemfsoftware-vitest`. `@systemfsoftware/vitest` documentation examples import from `@systemfsoftware/vitest`.
|
|
56
|
-
|
|
57
|
-
The lawful runner is published under its own name, `@systemfsoftware/vitest`, starting at `0.1.0`, so peers declared as `^0.1.0` accept its patch releases.
|
|
58
|
-
|
|
59
|
-
- Kernel runs are serialized. A run started while another is live now waits behind it, in arrival order, instead of failing: two runs never interleave, so a scenario never sees another run's decisions, and a suite whose cases drive the kernel can run its tests concurrently.
|
|
60
|
-
|
|
61
|
-
`@systemfsoftware/vitest` adds `captureRunBinding`, the running test's run binding. `bind(effect)` re-provides it to an effect a library runs on a runtime of its own — its own scheduler, a worker, a simulation kernel — so the checks inside it count as that test's assertions, report softly, and see the same `owned` regions.
|
|
62
|
-
|
|
63
|
-
`@systemfsoftware/effect-spec-runtime` runs a case that declares no live reason through that runner, and a case's annotations now reach the test's report.
|
|
7
|
+
A vitest test body's steps are unwound through Effect.onError, which covers the same failure and interruption cases as the earlier onExit check.
|
package/README.md
CHANGED
|
@@ -97,6 +97,18 @@ A passing test outside a declared-shared block runs a second time on a fresh bui
|
|
|
97
97
|
|
|
98
98
|
That is how a module-level counter, a shared cache, or a process-global histogram gets reported instead of staying green. `it.live` is re-run too, so a real-resource suite gets the same check. A declared-shared block is the one exception.
|
|
99
99
|
|
|
100
|
+
A registration can name what the second run runs with `rerun`, a generator body of the same shape. The second run still happens only after a clean first run, on a fresh build, and a failure there is still `LeakedState`. A harness whose first run already repeats the body many times uses it to run the body once more instead of repeating all of that work:
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
it('reads the stored row', function*({ expect }) {
|
|
104
|
+
// the first run
|
|
105
|
+
}, {
|
|
106
|
+
rerun: function*({ expect }) {
|
|
107
|
+
// the second run, on a fresh build of the services
|
|
108
|
+
},
|
|
109
|
+
})
|
|
110
|
+
```
|
|
111
|
+
|
|
100
112
|
## Concurrency and shuffle
|
|
101
113
|
|
|
102
114
|
Tests inside a block run concurrently and in shuffled order, and each concurrent test keeps its own failure list and check counts. Concurrency is what makes a cross-test leak reproducible: two tests that interleave are two tests whose state must not be shared. Nothing else pins their order.
|
|
@@ -199,11 +211,13 @@ CONFORMANCE_REPLAY="property=<hash>;seed=<n>;runs=<n>|..." pnpm test
|
|
|
199
211
|
Other property failures are exported from the package root as tagged errors — each carries its own fields:
|
|
200
212
|
|
|
201
213
|
- **`PropertyRefuted`**: `property` (name, site, seed, runs), `counterexample` (rendered, value), `shrinks`, `replay`
|
|
214
|
+
- **`PropertyExhausted`**: `property`, `discards`, `budget` (`{ runs, maxDiscards }`, `maxDiscards` null when uncapped), `replay` — the generator discarded too many draws, so the property was never evaluated; it is not a refutation and records nothing to the seed store
|
|
202
215
|
- **`NonBooleanVerdict`**: `property`, `drawn` (rendered, value), `returned` (array of kinds), `replay`
|
|
203
216
|
- **`CoverageBelowMinimum`**: `property`, `classes` (array of {label, hits, runs, minimum}), `replay`
|
|
204
|
-
- **`SelfModelLaw`**: `
|
|
217
|
+
- **`SelfModelLaw`**: `law`, `site` — the law compared the subject to itself
|
|
205
218
|
- **`SeedStoreUnreadable`**: `file`, `line`, `detail` — a seed store file's line could not be decoded
|
|
206
219
|
- **`ReplayUnreadable`**: `text` — `CONFORMANCE_REPLAY` names neither the kernel's `seed=…;path=…` nor a property entry
|
|
220
|
+
- **`ReplayNoLongerReproduces`**: `property`, `replay` — a `CONFORMANCE_REPLAY` replay no longer reproduces its recorded failure
|
|
207
221
|
|
|
208
222
|
A reporter receives every field on the raw error, so a script or agent narrows by `_tag` and reads the fields directly without parsing messages:
|
|
209
223
|
|
|
@@ -239,6 +253,8 @@ export default defineConfig({
|
|
|
239
253
|
|
|
240
254
|
Recorded seeds replay before novel draws on every run, whatever the budget. Only a refuted or non-boolean failure writes, and only in a run that is not derandomized and does not set `record: false`; the shared config sets `record: false` in CI and in Stryker workers. Commit seed store updates like snapshot files.
|
|
241
255
|
|
|
256
|
+
**Stale seeds**: a recorded seed-store refutation whose draw now passes no longer fails the property; the property's novel draws decide it, and the stale line can be deleted. A recorded draw that still fails but whose recorded shrink steps no longer replay (the generator's shrinking or the failure's kind changed) refutes the property with that draw, unshrunk, as its counterexample. An explicit `CONFORMANCE_REPLAY` replay that no longer reproduces its failure fails with `ReplayNoLongerReproduces` — the stored seed-store path is the one that passes.
|
|
257
|
+
|
|
242
258
|
**Generator changes**: if a property's generator changes, its recorded seeds may no longer produce their old counterexamples, so the failure stops reproducing. Cases that must always run belong in the test source itself, not in the seed store.
|
|
243
259
|
|
|
244
260
|
**The `record` option**: `{ runs: 30, record: false }` opts out of writing seeds for a run; the engine still reads and replays existing seeds.
|
|
@@ -128,7 +128,7 @@ type Assertion<A> = V.Assertion<void, A>;
|
|
|
128
128
|
/** @internal */
|
|
129
129
|
type MakeAssertion = <A>(actual: A, message?: string) => Assertion<A>;
|
|
130
130
|
/** @internal */
|
|
131
|
-
type Judgement = (make: MakeAssertion) =>
|
|
131
|
+
type Judgement = (make: MakeAssertion) => Opaque;
|
|
132
132
|
/**
|
|
133
133
|
* The service a check needs. `judge` counts the check and throws {@link refusePiecewise} when a check already ran
|
|
134
134
|
* since the last {@link AssertedShape.step}; `step` opens a new observed state.
|
|
@@ -136,7 +136,7 @@ type Judgement = (make: MakeAssertion) => void;
|
|
|
136
136
|
* @internal
|
|
137
137
|
*/
|
|
138
138
|
interface AssertedShape {
|
|
139
|
-
readonly judge: (judgement: Judgement) =>
|
|
139
|
+
readonly judge: (judgement: Judgement) => Opaque;
|
|
140
140
|
readonly step: () => void;
|
|
141
141
|
}
|
|
142
142
|
declare const Asserted_base: Context.ServiceClass<Asserted, "@systemfsoftware/vitest/Asserted", AssertedShape>;
|
|
@@ -5,7 +5,6 @@ import * as Schema$1 from "effect/Schema";
|
|
|
5
5
|
import * as Tracer from "effect/Tracer";
|
|
6
6
|
import { Schema } from "effect";
|
|
7
7
|
import * as Arbitrary from "effect/Arbitrary";
|
|
8
|
-
//#endregion
|
|
9
8
|
//#region src/internal/errors.schema.d.ts
|
|
10
9
|
/**
|
|
11
10
|
* The contract rules a rendered failure record can break (R10, KTD7).
|
|
@@ -28,19 +27,6 @@ declare const Witness: Schema.Struct<{
|
|
|
28
27
|
}>;
|
|
29
28
|
/** @internal */
|
|
30
29
|
type Witness = typeof Witness.Type;
|
|
31
|
-
/**
|
|
32
|
-
* One property involved in a failure: its full name, its declaration site, its seed and its run count (R2).
|
|
33
|
-
*
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
36
|
-
declare const PropertyRun: Schema.Struct<{
|
|
37
|
-
readonly name: Schema.String;
|
|
38
|
-
readonly site: Schema.NullOr<Schema.String>;
|
|
39
|
-
readonly seed: Schema.brand<Schema.Int, "PropertySeed">;
|
|
40
|
-
readonly runs: Schema.brand<Schema.Int, "PropertyRunCount">;
|
|
41
|
-
}>;
|
|
42
|
-
/** @internal */
|
|
43
|
-
type PropertyRun = typeof PropertyRun.Type;
|
|
44
30
|
declare const PropertyRefuted_base: Schema.Class<PropertyRefuted, Schema.TaggedStruct<"PropertyRefuted", {
|
|
45
31
|
readonly property: Schema.Struct<{
|
|
46
32
|
readonly name: Schema.String;
|
|
@@ -54,7 +40,9 @@ declare const PropertyRefuted_base: Schema.Class<PropertyRefuted, Schema.TaggedS
|
|
|
54
40
|
}>;
|
|
55
41
|
readonly shrinks: Schema.brand<Schema.Int, "PropertyShrinkCount">;
|
|
56
42
|
readonly replay: Schema.String;
|
|
57
|
-
}>, import("effect/Cause").YieldableError
|
|
43
|
+
}>, import("effect/Cause").YieldableError & {
|
|
44
|
+
readonly brand: unique symbol;
|
|
45
|
+
}>;
|
|
58
46
|
/**
|
|
59
47
|
* A falsified property: the property that ran, the shrunk counterexample the generator settled on, and how many
|
|
60
48
|
* shrink steps it took to reach it (R2-R4).
|
|
@@ -64,6 +52,26 @@ declare const PropertyRefuted_base: Schema.Class<PropertyRefuted, Schema.TaggedS
|
|
|
64
52
|
declare class PropertyRefuted extends PropertyRefuted_base {
|
|
65
53
|
get message(): string;
|
|
66
54
|
}
|
|
55
|
+
declare const PropertyExhausted_base: Schema.Class<PropertyExhausted, Schema.TaggedStruct<"PropertyExhausted", {
|
|
56
|
+
readonly property: Schema.Struct<{
|
|
57
|
+
readonly name: Schema.String;
|
|
58
|
+
readonly site: Schema.NullOr<Schema.String>;
|
|
59
|
+
readonly seed: Schema.brand<Schema.Int, "PropertySeed">;
|
|
60
|
+
readonly runs: Schema.brand<Schema.Int, "PropertyRunCount">;
|
|
61
|
+
}>;
|
|
62
|
+
readonly discards: Schema.brand<Schema.Int, "PropertyRunCount">;
|
|
63
|
+
readonly budget: Schema.Struct<{
|
|
64
|
+
readonly runs: Schema.brand<Schema.Int, "PropertyRunCount">;
|
|
65
|
+
readonly maxDiscards: Schema.NullOr<Schema.brand<Schema.Int, "PropertyRunCount">>;
|
|
66
|
+
}>;
|
|
67
|
+
readonly replay: Schema.String;
|
|
68
|
+
}>, import("effect/Cause").YieldableError & {
|
|
69
|
+
readonly brand: unique symbol;
|
|
70
|
+
}>;
|
|
71
|
+
/** @internal */
|
|
72
|
+
declare class PropertyExhausted extends PropertyExhausted_base {
|
|
73
|
+
get message(): string;
|
|
74
|
+
}
|
|
67
75
|
declare const NonBooleanVerdict_base: Schema.Class<NonBooleanVerdict, Schema.TaggedStruct<"NonBooleanVerdict", {
|
|
68
76
|
readonly property: Schema.Struct<{
|
|
69
77
|
readonly name: Schema.String;
|
|
@@ -77,7 +85,9 @@ declare const NonBooleanVerdict_base: Schema.Class<NonBooleanVerdict, Schema.Tag
|
|
|
77
85
|
}>;
|
|
78
86
|
readonly returned: Schema.$Array<Schema.Literals<readonly ["undefined", "object", "boolean", "number", "bigint", "string", "symbol", "function", "effect"]>>;
|
|
79
87
|
readonly replay: Schema.String;
|
|
80
|
-
}>, import("effect/Cause").YieldableError
|
|
88
|
+
}>, import("effect/Cause").YieldableError & {
|
|
89
|
+
readonly brand: unique symbol;
|
|
90
|
+
}>;
|
|
81
91
|
/**
|
|
82
92
|
* A verdict that was not a literal boolean: the property that ran, the first drawn values whose verdict was not a
|
|
83
93
|
* boolean, and every kind of value the property returned (R4).
|
|
@@ -101,7 +111,9 @@ declare const CoverageBelowMinimum_base: Schema.Class<CoverageBelowMinimum, Sche
|
|
|
101
111
|
readonly minimum: Schema.Finite;
|
|
102
112
|
}>>;
|
|
103
113
|
readonly replay: Schema.String;
|
|
104
|
-
}>, import("effect/Cause").YieldableError
|
|
114
|
+
}>, import("effect/Cause").YieldableError & {
|
|
115
|
+
readonly brand: unique symbol;
|
|
116
|
+
}>;
|
|
105
117
|
/**
|
|
106
118
|
* A property whose declared coverage classes stayed under their minima: the property and the failed classes, in
|
|
107
119
|
* declaration order (R7).
|
|
@@ -112,9 +124,11 @@ declare class CoverageBelowMinimum extends CoverageBelowMinimum_base {
|
|
|
112
124
|
get message(): string;
|
|
113
125
|
}
|
|
114
126
|
declare const SelfModelLaw_base: Schema.Class<SelfModelLaw, Schema.TaggedStruct<"SelfModelLaw", {
|
|
115
|
-
readonly
|
|
127
|
+
readonly law: Schema.String;
|
|
116
128
|
readonly site: Schema.NullOr<Schema.String>;
|
|
117
|
-
}>, import("effect/Cause").YieldableError
|
|
129
|
+
}>, import("effect/Cause").YieldableError & {
|
|
130
|
+
readonly brand: unique symbol;
|
|
131
|
+
}>;
|
|
118
132
|
/**
|
|
119
133
|
* A model law given the subject itself as its oracle, so it compares nothing (R13).
|
|
120
134
|
*
|
|
@@ -127,7 +141,9 @@ declare const SeedStoreUnreadable_base: Schema.Class<SeedStoreUnreadable, Schema
|
|
|
127
141
|
readonly file: Schema.String;
|
|
128
142
|
readonly line: Schema.Int;
|
|
129
143
|
readonly detail: Schema.String;
|
|
130
|
-
}>, import("effect/Cause").YieldableError
|
|
144
|
+
}>, import("effect/Cause").YieldableError & {
|
|
145
|
+
readonly brand: unique symbol;
|
|
146
|
+
}>;
|
|
131
147
|
/**
|
|
132
148
|
* A seed-store line that could not be decoded (R16, KTD6).
|
|
133
149
|
*
|
|
@@ -162,7 +178,9 @@ declare const VacuousProperty_base: Schema.Class<VacuousProperty, Schema.TaggedS
|
|
|
162
178
|
readonly kind: Schema.String;
|
|
163
179
|
}>>;
|
|
164
180
|
readonly replay: Schema.String;
|
|
165
|
-
}>, import("effect/Cause").YieldableError
|
|
181
|
+
}>, import("effect/Cause").YieldableError & {
|
|
182
|
+
readonly brand: unique symbol;
|
|
183
|
+
}>;
|
|
166
184
|
/**
|
|
167
185
|
* Thrown at file end when no property in the file refuted a subject's constant impostor (R12, R5, R6).
|
|
168
186
|
*
|
|
@@ -173,11 +191,34 @@ declare class VacuousProperty extends VacuousProperty_base {
|
|
|
173
191
|
}
|
|
174
192
|
declare const ReplayUnreadable_base: Schema.Class<ReplayUnreadable, Schema.TaggedStruct<"ReplayUnreadable", {
|
|
175
193
|
readonly text: Schema.String;
|
|
176
|
-
}>, import("effect/Cause").YieldableError
|
|
194
|
+
}>, import("effect/Cause").YieldableError & {
|
|
195
|
+
readonly brand: unique symbol;
|
|
196
|
+
}>;
|
|
177
197
|
/** @internal */
|
|
178
198
|
declare class ReplayUnreadable extends ReplayUnreadable_base {
|
|
179
199
|
get message(): string;
|
|
180
200
|
}
|
|
201
|
+
declare const ReplayNoLongerReproduces_base: Schema.Class<ReplayNoLongerReproduces, Schema.TaggedStruct<"ReplayNoLongerReproduces", {
|
|
202
|
+
readonly property: Schema.Struct<{
|
|
203
|
+
readonly name: Schema.String;
|
|
204
|
+
readonly site: Schema.NullOr<Schema.String>;
|
|
205
|
+
readonly seed: Schema.brand<Schema.Int, "PropertySeed">;
|
|
206
|
+
readonly runs: Schema.brand<Schema.Int, "PropertyRunCount">;
|
|
207
|
+
}>;
|
|
208
|
+
readonly replay: Schema.String;
|
|
209
|
+
}>, import("effect/Cause").YieldableError & {
|
|
210
|
+
readonly brand: unique symbol;
|
|
211
|
+
}>;
|
|
212
|
+
/**
|
|
213
|
+
* An explicit `CONFORMANCE_REPLAY` replay whose recorded failure no longer reproduces: after the root re-check,
|
|
214
|
+
* the replay still mismatched, so no draw reproduces the failure the text names. The recorded seed-store path is
|
|
215
|
+
* not this — there the entry is one candidate among the novel draws, and only a draw that still fails refutes.
|
|
216
|
+
*
|
|
217
|
+
* @internal
|
|
218
|
+
*/
|
|
219
|
+
declare class ReplayNoLongerReproduces extends ReplayNoLongerReproduces_base {
|
|
220
|
+
get message(): string;
|
|
221
|
+
}
|
|
181
222
|
//#endregion
|
|
182
223
|
//#region src/internal/failure-record.d.ts
|
|
183
224
|
/** A value the renderer narrows rather than assumes. */
|
|
@@ -351,46 +392,8 @@ type MemberRecord = {
|
|
|
351
392
|
* @internal
|
|
352
393
|
*/
|
|
353
394
|
type Subject = SubjectFunction | MemberRecord;
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
*
|
|
357
|
-
* @internal
|
|
358
|
-
*/
|
|
359
|
-
interface FrozenOutput {
|
|
360
|
-
readonly member: string;
|
|
361
|
-
readonly output: Opaque;
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* One property's verdict against a subject's impostor: whether the property refuted the fake, the property it
|
|
365
|
-
* ran, and the raw outputs the fake froze for it.
|
|
366
|
-
*
|
|
367
|
-
* @internal
|
|
368
|
-
*/
|
|
369
|
-
interface Refutation {
|
|
370
|
-
/** `true` when the property falsified for the impostor, so the property does pin the subject down. */
|
|
371
|
-
readonly refuted: boolean;
|
|
372
|
-
readonly property: PropertyRun;
|
|
373
|
-
/** The property's identity hash, so a vacuous verdict's replay text can name it (R9, R11). */
|
|
374
|
-
readonly identity: number;
|
|
375
|
-
readonly frozen: ReadonlyArray<FrozenOutput>;
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* The R12 repair verdict for one subject no property in the file refuted.
|
|
379
|
-
*
|
|
380
|
-
* @internal
|
|
381
|
-
*/
|
|
382
|
-
interface FileLedger {
|
|
383
|
-
readonly record: (subject: Subject, verdict: Refutation) => void;
|
|
384
|
-
/** Records a law kind exempt from the gate, so a refusal can list it (R6). */
|
|
385
|
-
readonly recordExempt: (name: string, kind: string) => void;
|
|
386
|
-
/** The single refusal when at least one subject is vacuous, or `undefined` when the file holds. */
|
|
387
|
-
readonly finalise: () => VacuousProperty | undefined;
|
|
388
|
-
}
|
|
389
|
-
declare namespace kinds_d_exports {
|
|
390
|
-
export { LawApi, LawKind, LawSubject, MetamorphicRelation, deterministicHolds, idempotentHolds, invariantHolds, metamorphicHolds, modelHolds, roundTripHolds, spreadValues };
|
|
391
|
-
}
|
|
392
|
-
/** @internal */
|
|
393
|
-
type LawKind = 'model' | 'metamorphic' | 'roundTrip' | 'invariant' | 'idempotent' | 'deterministic';
|
|
395
|
+
//#endregion
|
|
396
|
+
//#region src/internal/property/kinds.d.ts
|
|
394
397
|
/**
|
|
395
398
|
* A subject of a law kind: a function of the generated values.
|
|
396
399
|
*
|
|
@@ -419,27 +422,8 @@ interface LawApi {
|
|
|
419
422
|
readonly idempotent: <const G extends Gens, N extends number, S extends (value: ElementValues<G>) => ElementValues<G>>(name: string, spec: PropertySpec<G, S, N>) => void;
|
|
420
423
|
readonly deterministic: <const G extends Gens, A, N extends number, S extends LawSubject<G, A>>(name: string, spec: PropertySpec<G, S, N>) => void;
|
|
421
424
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
*
|
|
425
|
-
* @internal
|
|
426
|
-
*/
|
|
427
|
-
declare const spreadValues: <G extends Gens>(values: Values<G>) => ReadonlyArray<ElementValues<G>>;
|
|
428
|
-
/** @internal */
|
|
429
|
-
declare const modelHolds: <G extends Gens, A>(oracle: LawSubject<G, A>) => (subject: LawSubject<G, A>, values: Values<G>) => boolean;
|
|
430
|
-
/** @internal */
|
|
431
|
-
declare const metamorphicHolds: <G extends Gens, A>(relation: MetamorphicRelation<G, A>) => (subject: LawSubject<G, A>, values: Values<G>) => boolean;
|
|
432
|
-
/** @internal */
|
|
433
|
-
declare const roundTripHolds: <G extends Gens, E>(decode: (encoded: E) => Values<G>) => (subject: LawSubject<G, E>, values: Values<G>) => boolean;
|
|
434
|
-
/** @internal */
|
|
435
|
-
declare const invariantHolds: <G extends Gens, A>(holds: (output: A, ...values: ReadonlyArray<ElementValues<G>>) => boolean) => (subject: LawSubject<G, A>, values: Values<G>) => boolean;
|
|
436
|
-
/** @internal */
|
|
437
|
-
declare const idempotentHolds: <G extends Gens>() => (subject: (value: ElementValues<G>) => ElementValues<G>, values: Values<G>) => boolean;
|
|
438
|
-
/** @internal */
|
|
439
|
-
declare const deterministicHolds: <G extends Gens, A>() => (subject: LawSubject<G, A>, values: Values<G>) => boolean;
|
|
440
|
-
declare namespace engine_d_exports {
|
|
441
|
-
export { ArbitraryInput, CoveragePredicate, ElementValues, Gens, PropApi, PropertyRuntime, PropertySpec, PropertySubject, PropertyTask, Values, makeProperty };
|
|
442
|
-
}
|
|
425
|
+
//#endregion
|
|
426
|
+
//#region src/internal/property/engine.d.ts
|
|
443
427
|
/** @internal */
|
|
444
428
|
type ArbitraryInput = Schema$1.Top | Arbitrary.Arbitrary<Schema$1.Top['Type']>;
|
|
445
429
|
/** @internal */
|
|
@@ -471,33 +455,10 @@ interface PropertySpec<G extends Gens, S extends PropertySubject, N extends numb
|
|
|
471
455
|
readonly arbitrary?: Arbitrary.CheckOptions;
|
|
472
456
|
}
|
|
473
457
|
/** @internal */
|
|
474
|
-
interface PropertyTask {
|
|
475
|
-
/** The property's run-time identity (KTD3): its package, project-relative file and full name. */
|
|
476
|
-
readonly identity: TestIdentity;
|
|
477
|
-
/** The absolute path of the test file whose seed store is read and written beside it (KTD6); `null` keeps no store. */
|
|
478
|
-
readonly filepath: string | null;
|
|
479
|
-
/** The provided property budget, or `undefined` when the run provided none. */
|
|
480
|
-
readonly budget: ProvidedCheckDefaults | undefined;
|
|
481
|
-
}
|
|
482
|
-
/** @internal */
|
|
483
|
-
interface PropertyRuntime<R> {
|
|
484
|
-
/** Registers the property's program; the runtime runs it inside the test it registers, under that test's binding. */
|
|
485
|
-
readonly register: (name: string, program: (task: PropertyTask) => Effect$1.Effect<void, Cause.Cause<NonBooleanVerdict>, never>) => void;
|
|
486
|
-
readonly provide: <A, E>(effect: Effect$1.Effect<A, E, R>) => Effect$1.Effect<A, E, never>;
|
|
487
|
-
/** The file ledger every property of this runtime records its impostor verdict into (R20, KTD10). */
|
|
488
|
-
readonly ledger: FileLedger;
|
|
489
|
-
}
|
|
490
|
-
/** @internal */
|
|
491
458
|
interface PropApi<R> {
|
|
492
459
|
readonly prop: <const G extends Gens, S extends PropertySubject, N extends number>(name: string, spec: PropertySpec<G, S, N>, holds: (subject: S, values: Values<G>) => boolean) => void;
|
|
493
460
|
readonly effectProp: <const G extends Gens, S extends PropertySubject, N extends number, E>(name: string, spec: PropertySpec<G, S, N>, holds: (subject: S, values: Values<G>) => Effect$1.Effect<boolean, E, R>) => void;
|
|
494
461
|
readonly law: LawApi;
|
|
495
462
|
}
|
|
496
|
-
/**
|
|
497
|
-
* The property surface over one runtime: `prop`, `effectProp`, and the R13 law kinds routed through the gate.
|
|
498
|
-
*
|
|
499
|
-
* @internal
|
|
500
|
-
*/
|
|
501
|
-
declare const makeProperty: <R>(runtime: PropertyRuntime<R>) => PropApi<R>;
|
|
502
463
|
//#endregion
|
|
503
|
-
export { VacuousProperty as A,
|
|
464
|
+
export { VacuousProperty as A, NonBooleanVerdict as C, ReplayUnreadable as D, ReplayNoLongerReproduces as E, Breach as M, SeedStoreUnreadable as O, CoverageBelowMinimum as S, PropertyRefuted as T, renderFailureRecord as _, PropertySubject as a, throwFailureRecord as b, PropertyBudget as c, AttributeValue as d, FailureRecord as f, TestIdentity as g, ReplayValue as h, PropertySpec as i, Witness as j, SelfModelLaw as k, ProvidedCheckDefaults as l, JsonValue as m, Gens as n, Values as o, FailureRecordInput as p, PropApi as r, LawApi as s, ArbitraryInput as t, checkDefaultsKey as u, summaryOf as v, PropertyExhausted as w, witnessOf as x, testIdentityOf as y };
|