@ripplo/testing 0.1.0 → 0.1.1
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 +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -263,7 +263,7 @@ export const orgNameIs: ObserverHandle<{ orgId: string; expectedName: string }>
|
|
|
263
263
|
|
|
264
264
|
**Budget tiers** (framework-defined, not numeric):
|
|
265
265
|
|
|
266
|
-
- `"fast"` — ~
|
|
266
|
+
- `"fast"` — ~5s with 100→1000ms backoff. Default. Synchronous DB reads.
|
|
267
267
|
- `"slow"` — ~30s with 250→2000ms backoff. Queue drains, replication settling.
|
|
268
268
|
- `"async"` — ~120s with 500→5000ms backoff. Webhooks, queue workers, LLM calls.
|
|
269
269
|
|
|
@@ -284,9 +284,9 @@ ripplo.implementObserver(orgNameIs, async (ctx, { orgId, expectedName }) => {
|
|
|
284
284
|
|
|
285
285
|
**ObserverContext provides:**
|
|
286
286
|
|
|
287
|
-
- `ctx.pass()` → assertion satisfied
|
|
288
|
-
- `ctx.retry(reason)` →
|
|
289
|
-
- `ctx.fail(reason)` → invariant violated
|
|
287
|
+
- `ctx.pass()` → assertion satisfied; stop polling.
|
|
288
|
+
- `ctx.retry(reason)` → **default**. Use for anything that might succeed on a later poll: row not found yet, status not transitioned, queue not drained, side effect still in flight. Runtime polls until the budget expires; the last `reason` surfaces in the failure detail.
|
|
289
|
+
- `ctx.fail(reason)` → **narrow**. Only when further polling cannot help — an invariant has been violated (wrong shape, contradictory value, forbidden state). Stops immediately. If you're tempted to use `fail` for "not found" or "not yet X", it should be `retry`.
|
|
290
290
|
- Any thrown exception is treated as `fail` with the error message.
|
|
291
291
|
|
|
292
292
|
### Usage in tests
|