@playfast/reform-proof 1.0.1 → 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/README.md +12 -12
- package/package.json +18 -18
- package/src/engine.ts +1405 -337
- package/src/errors.ts +0 -14
- package/src/fingerprint.test.ts +24 -0
- package/src/fingerprint.ts +73 -0
- package/src/index.ts +240 -216
- package/src/nested-feature.test.ts +174 -0
- package/src/runner.ts +5 -17
- package/src/structure-events.test.ts +9 -14
- package/src/structure-locators.test.ts +19 -32
- package/src/typed-seams.test.ts +6 -14
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ Drive a scene's compositions and assert on what they compute — deterministical
|
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
A reform
|
|
16
|
+
A reform _scene_ is renderer-neutral, so it can be exercised without a host. `@playfast/reform-proof` runs that same scene against a capturing UI: it dispatches typed events, settles the engine, and lets you assert on the **props a composition computed** — pure data, never rendered markup. The scene you prove is the exact scene `@playfast/reform-react` renders, so there is no seam between a passing test and production behavior.
|
|
17
17
|
|
|
18
18
|
## Install
|
|
19
19
|
|
|
@@ -39,27 +39,27 @@ const CounterScene = scene(Counter, { provide: [CounterLive] })
|
|
|
39
39
|
class Bumps extends ProductRequirement.make(Counter, 'bumps the count') {}
|
|
40
40
|
|
|
41
41
|
const bumps = Proof.implement(Bumps, CounterScene, function* (app) {
|
|
42
|
-
yield* app.actions.bump({})
|
|
43
|
-
const props = yield* app.props
|
|
42
|
+
yield* app.actions.bump({}) // dispatch a contract event, settle
|
|
43
|
+
const props = yield* app.props // read what the composition computed
|
|
44
44
|
yield* expect(props.count).toBe(1)
|
|
45
45
|
})
|
|
46
46
|
|
|
47
47
|
const product = Product.make(Counter, { requirements: [Bumps] })
|
|
48
48
|
const suite = Proof.suite(product, { proofs: [bumps] })
|
|
49
49
|
|
|
50
|
-
const result = await Proof.run(suite)
|
|
50
|
+
const result = await Proof.run(suite) // { product, results, ok }
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
## The workflow
|
|
54
54
|
|
|
55
|
-
| step
|
|
56
|
-
|
|
|
57
|
-
| Declare a requirement | `ProductRequirement.make(composition, statement)`
|
|
58
|
-
| Group requirements
|
|
59
|
-
| Implement a proof
|
|
60
|
-
| Compose a suite
|
|
61
|
-
| Run it
|
|
62
|
-
| Step it (for tooling) | `Proof.driver(suite) → ProofDriver[]`
|
|
55
|
+
| step | API |
|
|
56
|
+
| --------------------- | ------------------------------------------------------------ |
|
|
57
|
+
| Declare a requirement | `ProductRequirement.make(composition, statement)` |
|
|
58
|
+
| Group requirements | `Product.make(composition, { requirements })` |
|
|
59
|
+
| Implement a proof | `Proof.implement(requirement, scene, function* (app) { … })` |
|
|
60
|
+
| Compose a suite | `Proof.suite(product, { proofs })` |
|
|
61
|
+
| Run it | `Proof.run(suite) → Promise<SuiteResult>` |
|
|
62
|
+
| Step it (for tooling) | `Proof.driver(suite) → ProofDriver[]` |
|
|
63
63
|
|
|
64
64
|
The `statement` is a string-literal type, matched at `Proof.implement` so a requirement's name and its proof can never drift apart.
|
|
65
65
|
|
package/package.json
CHANGED
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playfast/reform-proof",
|
|
3
|
-
"
|
|
4
|
-
"version": "1.0.1",
|
|
5
|
-
"type": "module",
|
|
3
|
+
"version": "1.2.0",
|
|
6
4
|
"description": "Headless testing toolkit for reform — drive a scene's compositions and assert on the props they compute, with no DOM, timers, or text matching.",
|
|
7
5
|
"keywords": [
|
|
8
|
-
"reform",
|
|
9
6
|
"effect",
|
|
10
|
-
"testing",
|
|
11
7
|
"headless",
|
|
12
|
-
"proof"
|
|
8
|
+
"proof",
|
|
9
|
+
"reform",
|
|
10
|
+
"testing"
|
|
13
11
|
],
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/playfast/reform/issues"
|
|
14
|
+
},
|
|
14
15
|
"license": "MIT",
|
|
15
16
|
"repository": {
|
|
16
17
|
"type": "git",
|
|
17
18
|
"url": "https://github.com/playfast/reform.git",
|
|
18
19
|
"directory": "packages/proof"
|
|
19
20
|
},
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
21
|
+
"files": [
|
|
22
|
+
"src",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
23
26
|
"sideEffects": false,
|
|
24
27
|
"exports": {
|
|
25
28
|
"./package.json": "./package.json",
|
|
26
29
|
".": "./src/index.ts",
|
|
27
30
|
"./*": "./src/*.ts"
|
|
28
31
|
},
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
],
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
33
35
|
"scripts": {
|
|
34
36
|
"clean": "rm -rf dist .tsbuildinfo",
|
|
35
37
|
"check": "tsc --noEmit",
|
|
@@ -41,11 +43,9 @@
|
|
|
41
43
|
"lint:fix": "oxlint --fix src"
|
|
42
44
|
},
|
|
43
45
|
"peerDependencies": {
|
|
46
|
+
"@playfast/reform": "*",
|
|
44
47
|
"effect": "*",
|
|
45
|
-
"react": "^19.0.0"
|
|
46
|
-
"@playfast/reform": "*"
|
|
48
|
+
"react": "^19.0.0"
|
|
47
49
|
},
|
|
48
|
-
"
|
|
49
|
-
"access": "public"
|
|
50
|
-
}
|
|
50
|
+
"playbook": "./playbook"
|
|
51
51
|
}
|