@voltro/testing 0.85.0 → 0.86.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 +666 -0
- package/THIRD-PARTY-NOTICES.md +5 -33
- package/dist/client.js +73 -98
- package/dist/dialect.js +244 -145
- package/dist/factory.js +65 -0
- package/dist/fixtureRow.js +30 -0
- package/dist/formBindingHarness.js +46 -0
- package/dist/hydrateFixtureRows.js +22 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.js +19 -933
- package/dist/invoke.js +44 -0
- package/dist/mockClock.js +78 -0
- package/dist/mockLLM.js +19 -0
- package/dist/mockWebhooks.js +26 -0
- package/dist/platform.js +1 -5
- package/dist/reachable.js +27 -0
- package/dist/serviceApiMock.js +53 -0
- package/dist/subject.js +11 -0
- package/dist/subscribeContext.js +16 -0
- package/dist/testApps.js +111 -0
- package/dist/testContext.js +248 -0
- package/dist/testEventBus.js +73 -0
- package/dist/testRequest.js +119 -0
- package/dist/workflowRunner.js +85 -0
- package/package.json +9 -9
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Third-Party Notices — @voltro/testing
|
|
2
2
|
|
|
3
|
-
This package
|
|
3
|
+
This package uses the open-source software listed below. Each is the
|
|
4
4
|
property of its respective copyright holders and is used under the terms of
|
|
5
5
|
its license. This file is provided for attribution; it grants no rights in
|
|
6
6
|
@voltro/testing itself, which is proprietary (see LICENSE).
|
|
7
7
|
|
|
8
|
-
Generated from the resolved runtime dependency closure (
|
|
8
|
+
Generated from the resolved runtime dependency closure (41 packages).
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -3636,34 +3636,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
3636
3636
|
SOFTWARE.
|
|
3637
3637
|
```
|
|
3638
3638
|
|
|
3639
|
-
## layerr@3.0.0
|
|
3640
|
-
|
|
3641
|
-
License: MIT
|
|
3642
|
-
|
|
3643
|
-
```
|
|
3644
|
-
MIT License
|
|
3645
|
-
|
|
3646
|
-
Copyright (c) 2020 Perry Mitchell
|
|
3647
|
-
|
|
3648
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3649
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
3650
|
-
in the Software without restriction, including without limitation the rights
|
|
3651
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
3652
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
3653
|
-
furnished to do so, subject to the following conditions:
|
|
3654
|
-
|
|
3655
|
-
The above copyright notice and this permission notice shall be included in all
|
|
3656
|
-
copies or substantial portions of the Software.
|
|
3657
|
-
|
|
3658
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
3659
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
3660
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
3661
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
3662
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
3663
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
3664
|
-
SOFTWARE.
|
|
3665
|
-
```
|
|
3666
|
-
|
|
3667
3639
|
## lib0@0.2.117
|
|
3668
3640
|
|
|
3669
3641
|
License: MIT
|
|
@@ -4013,14 +3985,14 @@ Apache License
|
|
|
4013
3985
|
limitations under the License.
|
|
4014
3986
|
```
|
|
4015
3987
|
|
|
4016
|
-
##
|
|
3988
|
+
## ulid@3.0.2
|
|
4017
3989
|
|
|
4018
3990
|
License: MIT
|
|
4019
3991
|
|
|
4020
3992
|
```
|
|
4021
|
-
MIT License
|
|
3993
|
+
The MIT License (MIT)
|
|
4022
3994
|
|
|
4023
|
-
Copyright (c)
|
|
3995
|
+
Copyright (c) 2017 Alizain Feerasta
|
|
4024
3996
|
|
|
4025
3997
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4026
3998
|
of this software and associated documentation files (the "Software"), to deal
|
package/dist/client.js
CHANGED
|
@@ -1,85 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}), l, u = () => (l = a(o, e, r.binding ?? {}), null), d = i(globalThis.document.createElement("div"));
|
|
15
|
-
return await t(async () => {
|
|
16
|
-
d.render(n(s.Provider, null, n(u)));
|
|
17
|
-
}), {
|
|
18
|
-
binding: () => l,
|
|
19
|
-
fill: (e, n) => {
|
|
20
|
-
t(() => {
|
|
21
|
-
l.field(e).setValue(n);
|
|
22
|
-
});
|
|
23
|
-
},
|
|
24
|
-
blur: (e) => {
|
|
25
|
-
t(() => {
|
|
26
|
-
l.field(e).onBlur();
|
|
27
|
-
});
|
|
28
|
-
},
|
|
29
|
-
submit: async () => {
|
|
30
|
-
let e;
|
|
31
|
-
return await t(async () => {
|
|
32
|
-
e = await l.submit();
|
|
33
|
-
}), e;
|
|
34
|
-
},
|
|
35
|
-
errors: () => l.errors,
|
|
36
|
-
state: () => l.state,
|
|
37
|
-
client: s,
|
|
38
|
-
unmount: () => {
|
|
39
|
-
t(() => {
|
|
40
|
-
d.unmount();
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}, s = {
|
|
45
|
-
runPromise: e.runPromise,
|
|
46
|
-
runPromiseExit: e.runPromiseExit,
|
|
47
|
-
runFork: e.runFork,
|
|
48
|
-
dispose: () => e.void
|
|
49
|
-
}, c = (t = {}) => {
|
|
50
|
-
let a = t.apiName ?? "app", o = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = [];
|
|
51
|
-
for (let [e, n] of Object.entries(t.subscriptions ?? {})) o.set(e, {
|
|
1
|
+
import { renderFormBinding as e } from "./formBindingHarness.js";
|
|
2
|
+
import { Effect as t } from "effect";
|
|
3
|
+
import { createElement as n } from "react";
|
|
4
|
+
import { FrameworkRuntimesContext as r, INITIAL_RECOVERY_SNAPSHOT as i, RpcErrorBus as a } from "@voltro/client";
|
|
5
|
+
//#region src/client.tsx
|
|
6
|
+
var o = {
|
|
7
|
+
runPromise: t.runPromise,
|
|
8
|
+
runPromiseExit: t.runPromiseExit,
|
|
9
|
+
runFork: t.runFork,
|
|
10
|
+
dispose: () => t.void
|
|
11
|
+
}, s = (e = {}) => {
|
|
12
|
+
let s = e.apiName ?? "app", c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = [];
|
|
13
|
+
for (let [t, n] of Object.entries(e.subscriptions ?? {})) c.set(t, {
|
|
52
14
|
data: n,
|
|
53
15
|
error: void 0,
|
|
54
16
|
revision: 0,
|
|
55
17
|
pendingPatches: 0,
|
|
56
18
|
emittedAt: void 0
|
|
57
19
|
});
|
|
58
|
-
let
|
|
20
|
+
let f = (e) => c.get(e) ?? {
|
|
59
21
|
data: void 0,
|
|
60
22
|
error: void 0,
|
|
61
23
|
revision: -1,
|
|
62
24
|
pendingPatches: 0,
|
|
63
25
|
emittedAt: void 0
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
for (let t of
|
|
67
|
-
},
|
|
26
|
+
}, p = (e) => {
|
|
27
|
+
u.delete(e);
|
|
28
|
+
for (let t of l.get(e) ?? []) t();
|
|
29
|
+
}, m = (e) => String(e[0] ?? ""), h = {
|
|
68
30
|
peek: (e) => {
|
|
69
|
-
let t =
|
|
31
|
+
let t = m(e), n = u.get(t);
|
|
70
32
|
if (n) return n;
|
|
71
|
-
let r =
|
|
33
|
+
let r = f(t), i = {
|
|
72
34
|
data: r.data,
|
|
73
35
|
revision: r.revision,
|
|
74
36
|
emittedAt: r.emittedAt,
|
|
75
37
|
error: r.error,
|
|
76
38
|
pendingPatches: r.pendingPatches
|
|
77
39
|
};
|
|
78
|
-
return
|
|
40
|
+
return u.set(t, i), i;
|
|
79
41
|
},
|
|
80
42
|
subscribe: (e, t, n, r) => {
|
|
81
|
-
let i =
|
|
82
|
-
return a.add(r),
|
|
43
|
+
let i = m(e), a = l.get(i) ?? /* @__PURE__ */ new Set();
|
|
44
|
+
return a.add(r), l.set(i, a), { unsubscribe: () => {
|
|
83
45
|
a.delete(r);
|
|
84
46
|
} };
|
|
85
47
|
},
|
|
@@ -92,9 +54,9 @@ var o = async (e, r = {}) => {
|
|
|
92
54
|
update: () => {},
|
|
93
55
|
forTag: () => ({ patchedCount: 0 }),
|
|
94
56
|
refreshAll: () => {
|
|
95
|
-
|
|
57
|
+
g += 1;
|
|
96
58
|
}
|
|
97
|
-
},
|
|
59
|
+
}, g = 0, _ = {
|
|
98
60
|
rawTransport: "connected",
|
|
99
61
|
status: "connected",
|
|
100
62
|
failureCount: 0,
|
|
@@ -102,83 +64,96 @@ var o = async (e, r = {}) => {
|
|
|
102
64
|
failedSubscriptions: [],
|
|
103
65
|
pendingMutationReplays: 0,
|
|
104
66
|
mutationReplay: "unknown"
|
|
105
|
-
},
|
|
106
|
-
subscribe: (e) => (
|
|
107
|
-
|
|
67
|
+
}, v = /* @__PURE__ */ new Set(), y = new a(), b = !0, x = {
|
|
68
|
+
subscribe: (e) => (v.add(e), () => {
|
|
69
|
+
v.delete(e);
|
|
108
70
|
}),
|
|
109
|
-
getSnapshot: () =>
|
|
71
|
+
getSnapshot: () => _,
|
|
72
|
+
getServerSnapshot: () => i,
|
|
73
|
+
getPreloadSeedPermission: () => b,
|
|
74
|
+
invalidatePreloadSeeds: () => {
|
|
75
|
+
if (b) {
|
|
76
|
+
b = !1;
|
|
77
|
+
for (let e of v) e();
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
onVisibleError: (e) => y.on(e),
|
|
81
|
+
waitForProtocolReady: async (e, t) => !t?.aborted && _.rawTransport === "connected",
|
|
82
|
+
reserveMutationReplay: () => void 0,
|
|
83
|
+
waitForMutationReplaySupport: async () => !1,
|
|
84
|
+
replayWindowRemaining: () => 0,
|
|
110
85
|
reportExternalSuccess: () => {},
|
|
111
86
|
subjectSignal: new AbortController().signal
|
|
112
|
-
},
|
|
113
|
-
let i =
|
|
87
|
+
}, S = {}, C = (e, n, r) => {
|
|
88
|
+
let i = e.split("."), a = S;
|
|
114
89
|
for (let e of i.slice(0, -1)) a[e] = a[e] ?? {}, a = a[e];
|
|
115
|
-
a[i[i.length - 1]] = (i) =>
|
|
116
|
-
try: async () => (
|
|
90
|
+
a[i[i.length - 1]] = (i) => t.tryPromise({
|
|
91
|
+
try: async () => (d.push({
|
|
117
92
|
kind: n,
|
|
118
|
-
tag:
|
|
93
|
+
tag: e,
|
|
119
94
|
input: i
|
|
120
95
|
}), await r(i)),
|
|
121
96
|
catch: (e) => e
|
|
122
97
|
});
|
|
123
98
|
};
|
|
124
|
-
for (let [
|
|
125
|
-
for (let [
|
|
126
|
-
let
|
|
127
|
-
runtime:
|
|
128
|
-
cache:
|
|
129
|
-
recovery:
|
|
130
|
-
client:
|
|
99
|
+
for (let [t, n] of Object.entries(e.mutations ?? {})) C(t, "mutation", n);
|
|
100
|
+
for (let [t, n] of Object.entries(e.actions ?? {})) C(t, "action", n);
|
|
101
|
+
let w = {
|
|
102
|
+
runtime: o,
|
|
103
|
+
cache: h,
|
|
104
|
+
recovery: x,
|
|
105
|
+
client: S,
|
|
131
106
|
descriptors: {},
|
|
132
107
|
inspectBaseUrl: "http://test.local",
|
|
133
|
-
errorBus:
|
|
134
|
-
},
|
|
108
|
+
errorBus: y
|
|
109
|
+
}, T = {
|
|
135
110
|
get: (e) => {
|
|
136
|
-
if (e !==
|
|
137
|
-
return
|
|
111
|
+
if (e !== s) throw Error(`makeVoltroTestClient: component asked for api '${e}' but the harness was built for '${s}'. Pass { apiName: '${e}' }.`);
|
|
112
|
+
return w;
|
|
138
113
|
},
|
|
139
|
-
names: [
|
|
114
|
+
names: [s]
|
|
140
115
|
};
|
|
141
116
|
return {
|
|
142
|
-
Provider: ({ children: e }) => n(r.Provider, { value:
|
|
117
|
+
Provider: ({ children: e }) => n(r.Provider, { value: T }, e),
|
|
143
118
|
setSubscription: (e, t, n) => {
|
|
144
|
-
let r =
|
|
145
|
-
|
|
119
|
+
let r = f(e);
|
|
120
|
+
c.set(e, {
|
|
146
121
|
data: t,
|
|
147
122
|
error: void 0,
|
|
148
123
|
revision: r.revision + 1,
|
|
149
124
|
pendingPatches: n?.pendingPatches ?? 0,
|
|
150
125
|
emittedAt: n?.emittedAt
|
|
151
|
-
}),
|
|
126
|
+
}), p(e);
|
|
152
127
|
},
|
|
153
128
|
failSubscription: (e, t) => {
|
|
154
|
-
|
|
129
|
+
c.set(e, {
|
|
155
130
|
data: void 0,
|
|
156
131
|
error: t,
|
|
157
132
|
revision: -1,
|
|
158
133
|
pendingPatches: 0,
|
|
159
134
|
emittedAt: void 0
|
|
160
|
-
}),
|
|
135
|
+
}), p(e);
|
|
161
136
|
},
|
|
162
137
|
resetSubscription: (e) => {
|
|
163
|
-
|
|
138
|
+
c.delete(e), p(e);
|
|
164
139
|
},
|
|
165
|
-
calls:
|
|
140
|
+
calls: d,
|
|
166
141
|
setConnectionStatus: (e, t) => {
|
|
167
|
-
|
|
168
|
-
...
|
|
142
|
+
_ = {
|
|
143
|
+
..._,
|
|
169
144
|
...t,
|
|
170
145
|
status: e,
|
|
171
146
|
rawTransport: t?.rawTransport ?? (e === "connected" ? "connected" : "disconnected")
|
|
172
147
|
};
|
|
173
|
-
for (let e of
|
|
148
|
+
for (let e of v) e();
|
|
174
149
|
},
|
|
175
150
|
get refreshes() {
|
|
176
|
-
return
|
|
151
|
+
return g;
|
|
177
152
|
},
|
|
178
153
|
emitRpcError: (e) => {
|
|
179
|
-
|
|
154
|
+
w.errorBus.emit(e);
|
|
180
155
|
}
|
|
181
156
|
};
|
|
182
157
|
};
|
|
183
158
|
//#endregion
|
|
184
|
-
export {
|
|
159
|
+
export { o as FAKE_RUNTIME, s as makeVoltroTestClient, e as renderFormBinding };
|