Commit 299afbe
fix(cloud-shared): preserve real db/schemas exports in mock.module calls
Three service tests used mock.module("db/schemas", ...) with only a
hand-picked subset of table refs. Because Bun's mock.module is
process-global and keyed by absolute path, the partial mock leaked into
later tests in the same test:cloud run. Downstream code that imported
apps.ts (the repository) then crashed with:
SyntaxError: Export named 'appAnalytics' not found in module
'.../db/schemas/index.ts'
Spread the real schemas module into each mock so every export remains
defined; only the table refs the test specifically wants to stub are
overridden. Fixes Cloud Tests CI failures in stripe-event-helpers,
mcp-proxy-helpers, and a2a-agent-card.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 5f51d82 commit 299afbe
3 files changed
Lines changed: 9 additions & 0 deletions
File tree
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| 77 | + | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
0 commit comments