@btravstack/testing 0.14.0 → 0.15.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 +8 -0
- package/dist/index.cjs +4 -2
- package/dist/index.d.cts +3 -2
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +4 -2
- package/package.json +9 -10
package/README.md
CHANGED
|
@@ -92,6 +92,14 @@ answers the very instances the running graph holds once it is built — after
|
|
|
92
92
|
provides it where a starter would; `unit` is a module every submitted unit
|
|
93
93
|
forks, with no seed, before its work runs — and what that module needs joins
|
|
94
94
|
`module`'s own, so `start` names it instead of the first `submit()` failing.
|
|
95
|
+
- **`overridden(module, [providers])`** — substitute named providers into your
|
|
96
|
+
**real** composition root, rather than maintaining a parallel test root
|
|
97
|
+
beside it. It replaces one **provider**, never a subsystem: the replaced
|
|
98
|
+
provider's siblings still construct, so swapping a whole adapter stack is
|
|
99
|
+
still a different module composed in its place. An override for a port the
|
|
100
|
+
tree stopped providing is a `WiringDefect` ("nothing to override"), which is
|
|
101
|
+
what keeps a test root from drifting silently away from the real one — the
|
|
102
|
+
drift that four hand-maintained parallel roots had already produced here.
|
|
95
103
|
- **`createFakeClock(start?)`** — a `Clock` for `StartOptions.clock` whose
|
|
96
104
|
time moves only on `advance(ms)`.
|
|
97
105
|
|
package/dist/index.cjs
CHANGED
|
@@ -21,8 +21,9 @@ let _btravstack_di = require("@btravstack/di");
|
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
23
23
|
* The defaults are a test's: `signals: false` always (process-wide handlers
|
|
24
|
-
* would fight across a file), `probes: false`, `preDrainDelayMs: 0
|
|
25
|
-
* `
|
|
24
|
+
* would fight across a file), `probes: false`, `preDrainDelayMs: 0`, a
|
|
25
|
+
* `stopTimeoutMs` far out of reach and a silent `onEvent` — each overridable by
|
|
26
|
+
* `defaults` and again per call.
|
|
26
27
|
*
|
|
27
28
|
* Teardown is `stop()`, then `exited` is examined: a **`Defect`** fails the test
|
|
28
29
|
* even when the test never looked at `exited`, while a modeled `Err` passes
|
|
@@ -33,6 +34,7 @@ const bootFixture = (defaults = {}) => async ({}, use) => {
|
|
|
33
34
|
const boot = ((module, options = {}) => {
|
|
34
35
|
const app = (0, _btravstack_core.start)(module, {
|
|
35
36
|
preDrainDelayMs: 0,
|
|
37
|
+
stopTimeoutMs: 6e5,
|
|
36
38
|
onEvent: () => {},
|
|
37
39
|
probes: false,
|
|
38
40
|
...defaults,
|
package/dist/index.d.cts
CHANGED
|
@@ -27,8 +27,9 @@ type BootDefaults = Omit<StartOptions, "signals">;
|
|
|
27
27
|
* ```
|
|
28
28
|
*
|
|
29
29
|
* The defaults are a test's: `signals: false` always (process-wide handlers
|
|
30
|
-
* would fight across a file), `probes: false`, `preDrainDelayMs: 0
|
|
31
|
-
* `
|
|
30
|
+
* would fight across a file), `probes: false`, `preDrainDelayMs: 0`, a
|
|
31
|
+
* `stopTimeoutMs` far out of reach and a silent `onEvent` — each overridable by
|
|
32
|
+
* `defaults` and again per call.
|
|
32
33
|
*
|
|
33
34
|
* Teardown is `stop()`, then `exited` is examined: a **`Defect`** fails the test
|
|
34
35
|
* even when the test never looked at `exited`, while a modeled `Err` passes
|
package/dist/index.d.mts
CHANGED
|
@@ -27,8 +27,9 @@ type BootDefaults = Omit<StartOptions, "signals">;
|
|
|
27
27
|
* ```
|
|
28
28
|
*
|
|
29
29
|
* The defaults are a test's: `signals: false` always (process-wide handlers
|
|
30
|
-
* would fight across a file), `probes: false`, `preDrainDelayMs: 0
|
|
31
|
-
* `
|
|
30
|
+
* would fight across a file), `probes: false`, `preDrainDelayMs: 0`, a
|
|
31
|
+
* `stopTimeoutMs` far out of reach and a silent `onEvent` — each overridable by
|
|
32
|
+
* `defaults` and again per call.
|
|
32
33
|
*
|
|
33
34
|
* Teardown is `stop()`, then `exited` is examined: a **`Defect`** fails the test
|
|
34
35
|
* even when the test never looked at `exited`, while a modeled `Err` passes
|
package/dist/index.mjs
CHANGED
|
@@ -20,8 +20,9 @@ import { Module, Port, Provider, overrideProvider } from "@btravstack/di";
|
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
22
22
|
* The defaults are a test's: `signals: false` always (process-wide handlers
|
|
23
|
-
* would fight across a file), `probes: false`, `preDrainDelayMs: 0
|
|
24
|
-
* `
|
|
23
|
+
* would fight across a file), `probes: false`, `preDrainDelayMs: 0`, a
|
|
24
|
+
* `stopTimeoutMs` far out of reach and a silent `onEvent` — each overridable by
|
|
25
|
+
* `defaults` and again per call.
|
|
25
26
|
*
|
|
26
27
|
* Teardown is `stop()`, then `exited` is examined: a **`Defect`** fails the test
|
|
27
28
|
* even when the test never looked at `exited`, while a modeled `Err` passes
|
|
@@ -32,6 +33,7 @@ const bootFixture = (defaults = {}) => async ({}, use) => {
|
|
|
32
33
|
const boot = ((module, options = {}) => {
|
|
33
34
|
const app = start(module, {
|
|
34
35
|
preDrainDelayMs: 0,
|
|
36
|
+
stopTimeoutMs: 6e5,
|
|
35
37
|
onEvent: () => {},
|
|
36
38
|
probes: false,
|
|
37
39
|
...defaults,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@btravstack/testing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Test the applications @btravstack/core boots: an in-memory runtime, a fake clock, a boot fixture that stops what it started, and a tap into a running graph",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dependency-injection",
|
|
@@ -54,6 +54,9 @@
|
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
+
"@btravstack/config": "0.15.0",
|
|
58
|
+
"@btravstack/core": "0.15.0",
|
|
59
|
+
"@btravstack/di": "0.15.0",
|
|
57
60
|
"@btravstack/tsconfig": "0.4.0",
|
|
58
61
|
"@types/node": "26.4.1",
|
|
59
62
|
"@unthrown/vitest": "5.8.0",
|
|
@@ -62,17 +65,14 @@
|
|
|
62
65
|
"tsdown": "0.23.0",
|
|
63
66
|
"typescript": "7.0.2",
|
|
64
67
|
"unthrown": "5.8.0",
|
|
65
|
-
"vitest": "4.1.11"
|
|
66
|
-
"@btravstack/config": "0.14.0",
|
|
67
|
-
"@btravstack/core": "0.14.0",
|
|
68
|
-
"@btravstack/di": "0.14.0"
|
|
68
|
+
"vitest": "4.1.11"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
+
"@btravstack/config": "^0.15.0",
|
|
72
|
+
"@btravstack/core": "^0.15.0",
|
|
73
|
+
"@btravstack/di": "^0.15.0",
|
|
71
74
|
"jose": "^6",
|
|
72
|
-
"unthrown": "^5.0.0"
|
|
73
|
-
"@btravstack/config": "^0.14.0",
|
|
74
|
-
"@btravstack/core": "^0.14.0",
|
|
75
|
-
"@btravstack/di": "^0.14.0"
|
|
75
|
+
"unthrown": "^5.0.0"
|
|
76
76
|
},
|
|
77
77
|
"peerDependenciesMeta": {
|
|
78
78
|
"jose": {
|
|
@@ -86,7 +86,6 @@
|
|
|
86
86
|
"build": "tsdown src/index.ts src/jwt.ts --format cjs,esm --dts --clean",
|
|
87
87
|
"dev": "tsdown src/index.ts src/jwt.ts --format cjs,esm --dts --watch",
|
|
88
88
|
"test": "vitest run --coverage",
|
|
89
|
-
"test:types": "tsc --noEmit -p tsconfig.test-d.json",
|
|
90
89
|
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test-d.json"
|
|
91
90
|
}
|
|
92
91
|
}
|