Commit ac5a54e
authored
test(adapters): adopt shared @chat-adapter/tests factories and matchers (#674)
Wires `@chat-adapter/tests` as a devDependency and registers its
matchers via `setupFiles: ["@chat-adapter/tests/setup"]` across all 11
platform adapters, then replaces bespoke local
`mockLogger`/`createMockState`/`createMockChatInstance` with the shared
factories and adopts `toHaveDispatched`/`not.toHaveDispatched` where
clean.
- 10 adapters migrated (gchat, messenger, teams, whatsapp, telegram,
discord, twilio, linear, github, slack). Positional
`createMockChatInstance(...)` call sites converted to the options API
(slack 100, linear 35).
- `web` left as-is — its suite uses the real `Chat`/`createMemoryState`
for e2e, so the shared factories don't apply.
- Platform SDK mocks (Octokit, WebClient, socket-mode, `@linear/sdk`,
`fetch`) and the Phase 1 `connectWebhookContract` descriptors are left
intact.
Net ~−540 lines of duplicated test scaffolding. Stacked on #673.
Tests-only, no changeset.
---------
Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>1 parent 840c0d1 commit ac5a54e
32 files changed
Lines changed: 439 additions & 934 deletions
File tree
- packages
- adapter-discord
- src
- adapter-gchat
- src
- adapter-github
- src
- adapter-linear
- src
- adapter-messenger
- src
- adapter-slack
- src
- adapter-teams
- src
- adapter-telegram
- src
- adapter-twilio
- src
- adapter-web
- adapter-whatsapp
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 37 | | |
61 | 38 | | |
62 | 39 | | |
| |||
71 | 48 | | |
72 | 49 | | |
73 | 50 | | |
74 | | - | |
| 51 | + | |
75 | 52 | | |
76 | 53 | | |
77 | 54 | | |
| |||
0 commit comments