Skip to content

@chat-adapter/tests@4.33.0

Latest

Choose a tag to compare

@github-actions github-actions released this 07 Jul 22:30
b1940d2

Minor Changes

  • e7a396a: Add two shared behavioral test contracts for adapter authors:

    • threadIdContract — verifies an adapter's thread-id codec round-trips (decode(encode(x))), prefixes ids with the adapter name, matches any pinned encoded strings, and (optionally) distinguishes DM from non-DM threads.
    • selfMessageContract — verifies an adapter dispatches inbound messages from other users (to processMessage by default) but ignores messages the bot authored itself, so it never replies to itself. Requires the matchers to be registered via setupFiles: ["@chat-adapter/tests/setup"].
  • a7fb1bc: Add connectWebhookContract, a shared Vitest suite for verifying an adapter's Vercel Connect webhook verification. Given a small per-adapter descriptor (how to build the adapter in Connect mode and craft an inbound webhook), it asserts the behavior every Connect-capable adapter shares: a webhookVerifier replaces the native signature/secret check and gates inbound requests — accept (200) on a truthy result, reject (401) on a thrown error or falsy result — and is invoked with the request and raw body. Connect-capable adapters can opt in with ~10 lines.