@syncular/testkit 0.25.1 → 0.26.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/dist/faults.d.ts +4 -1
- package/dist/faults.js +4 -1
- package/package.json +4 -4
- package/src/faults.ts +4 -1
package/dist/faults.d.ts
CHANGED
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
* - drop response — the server processed it, the ack is lost;
|
|
18
18
|
* - duplicate — the request is delivered twice (replayed bytes);
|
|
19
19
|
* - truncate — the response is cut short (decode-error surfacing);
|
|
20
|
-
* - segment faults — the same, at the segment download hop
|
|
20
|
+
* - segment faults — the same, at the segment download hop;
|
|
21
|
+
* - realtime refusal — the next realtime connect fails before any socket opens.
|
|
21
22
|
*/
|
|
22
23
|
/** Deterministic PRNG (mulberry32) — seeded per scenario. */
|
|
23
24
|
export declare function seededRandom(seed: number): () => number;
|
|
@@ -46,6 +47,8 @@ export declare class TransportFaults {
|
|
|
46
47
|
dropNextUrlFetches: number;
|
|
47
48
|
/** Corrupt the next signed-URL fetch's bytes (§5.1 tamper). */
|
|
48
49
|
corruptNextUrlFetch: boolean;
|
|
50
|
+
/** Refuse the next realtime connect (a refused §8.8 handshake). */
|
|
51
|
+
refuseNextRealtimeConnect: boolean;
|
|
49
52
|
constructor(random: () => number);
|
|
50
53
|
/** Seeded cut point: at least 1 byte kept, at least 1 byte removed. */
|
|
51
54
|
truncate(bytes: Uint8Array): Uint8Array;
|
package/dist/faults.js
CHANGED
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
* - drop response — the server processed it, the ack is lost;
|
|
18
18
|
* - duplicate — the request is delivered twice (replayed bytes);
|
|
19
19
|
* - truncate — the response is cut short (decode-error surfacing);
|
|
20
|
-
* - segment faults — the same, at the segment download hop
|
|
20
|
+
* - segment faults — the same, at the segment download hop;
|
|
21
|
+
* - realtime refusal — the next realtime connect fails before any socket opens.
|
|
21
22
|
*/
|
|
22
23
|
/** Deterministic PRNG (mulberry32) — seeded per scenario. */
|
|
23
24
|
export function seededRandom(seed) {
|
|
@@ -61,6 +62,8 @@ export class TransportFaults {
|
|
|
61
62
|
dropNextUrlFetches = 0;
|
|
62
63
|
/** Corrupt the next signed-URL fetch's bytes (§5.1 tamper). */
|
|
63
64
|
corruptNextUrlFetch = false;
|
|
65
|
+
/** Refuse the next realtime connect (a refused §8.8 handshake). */
|
|
66
|
+
refuseNextRealtimeConnect = false;
|
|
64
67
|
#random;
|
|
65
68
|
constructor(random) {
|
|
66
69
|
this.#random = random;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncular/testkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "Syncular test kit: in-process loopback server + clients for integration scenarios",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Benjamin Kniffler",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"test": "bun test --preload ./test/setup.ts"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@syncular/server": "0.
|
|
68
|
-
"@syncular/client": "0.
|
|
67
|
+
"@syncular/server": "0.26.0",
|
|
68
|
+
"@syncular/client": "0.26.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": ">=18.0.0"
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@happy-dom/global-registrator": "^20.0.0",
|
|
80
|
-
"@syncular/react": "0.
|
|
80
|
+
"@syncular/react": "0.26.0",
|
|
81
81
|
"@testing-library/react": "^16.1.0",
|
|
82
82
|
"@types/react": "^18.3.0",
|
|
83
83
|
"react": "^18.3.1",
|
package/src/faults.ts
CHANGED
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
* - drop response — the server processed it, the ack is lost;
|
|
18
18
|
* - duplicate — the request is delivered twice (replayed bytes);
|
|
19
19
|
* - truncate — the response is cut short (decode-error surfacing);
|
|
20
|
-
* - segment faults — the same, at the segment download hop
|
|
20
|
+
* - segment faults — the same, at the segment download hop;
|
|
21
|
+
* - realtime refusal — the next realtime connect fails before any socket opens.
|
|
21
22
|
*/
|
|
22
23
|
|
|
23
24
|
/** Deterministic PRNG (mulberry32) — seeded per scenario. */
|
|
@@ -65,6 +66,8 @@ export class TransportFaults {
|
|
|
65
66
|
dropNextUrlFetches = 0;
|
|
66
67
|
/** Corrupt the next signed-URL fetch's bytes (§5.1 tamper). */
|
|
67
68
|
corruptNextUrlFetch = false;
|
|
69
|
+
/** Refuse the next realtime connect (a refused §8.8 handshake). */
|
|
70
|
+
refuseNextRealtimeConnect = false;
|
|
68
71
|
|
|
69
72
|
readonly #random: () => number;
|
|
70
73
|
|