@voltro/testing 0.81.0 → 0.82.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 +1520 -6
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/index.js +143 -133
- package/dist/platform.d.ts +14 -0
- package/dist/platform.js +46 -0
- package/package.json +13 -8
package/THIRD-PARTY-NOTICES.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnonymousPolicy } from '@voltro/protocol';
|
|
1
2
|
import { AppContext } from '@voltro/runtime';
|
|
2
3
|
import { AuthStrategy } from '@voltro/protocol';
|
|
3
4
|
import { changeDelete } from '@voltro/database';
|
|
@@ -368,9 +369,12 @@ export declare interface MakeTestAppOptions {
|
|
|
368
369
|
* itself the behaviour most worth testing, and the one `invoke` cannot reach.
|
|
369
370
|
*/
|
|
370
371
|
readonly strategies?: ReadonlyArray<AuthStrategy>;
|
|
371
|
-
/**
|
|
372
|
-
*
|
|
373
|
-
|
|
372
|
+
/** What an unauthenticated caller is — the app's `auth.anonymous`
|
|
373
|
+
* (`'refuse' | 'no-tenant' | 'header' | { tenantId }`), passed straight to
|
|
374
|
+
* `composeAuthStrategies`. Default: the `voltro dev` convenience — the
|
|
375
|
+
* `x-tenant` header's tenant, else `acme` — so a test sees what the dev
|
|
376
|
+
* server would; pass the app's own decision to see what serve would. */
|
|
377
|
+
readonly anonymous?: AnonymousPolicy;
|
|
374
378
|
/** HTTP idempotency binding — the same `{ store, header, ttlMs }` the serve
|
|
375
379
|
* path builds from `app.config.ts`'s `idempotency` field. */
|
|
376
380
|
readonly idempotency?: RestServeBindings['idempotency'];
|
|
@@ -641,10 +645,16 @@ export declare class MockWebhooks {
|
|
|
641
645
|
* testable. */
|
|
642
646
|
emit<P>(event: string | {
|
|
643
647
|
readonly id?: string;
|
|
648
|
+
readonly name?: string;
|
|
644
649
|
readonly event?: string;
|
|
645
650
|
}, payload: P): Promise<{
|
|
646
651
|
readonly delivered: number;
|
|
647
652
|
}>;
|
|
653
|
+
/** Mirrors `WebhooksServiceShape.listTargets`. No targets are subscribed
|
|
654
|
+
* here, so a handler that reads them — a status page, a health check — gets
|
|
655
|
+
* the empty list the real service gives an app that has none, instead of
|
|
656
|
+
* throwing because the recorder lacked the method. */
|
|
657
|
+
listTargets(_event?: string, _scope?: Readonly<Record<string, unknown>>): Promise<ReadonlyArray<never>>;
|
|
648
658
|
/** Every payload emitted for one event, oldest first. */
|
|
649
659
|
payloadsFor(event: string): ReadonlyArray<unknown>;
|
|
650
660
|
/** The most recent emission of an event, or undefined. */
|