Skip to content

Commit 02479cc

Browse files
baozhoutaoclaude
andauthored
test(metadata): mock driver 的 supports 收敛为空广告 (#4782) (#6545)
database-loader.test.ts 的 mock driver 把九个 off-spec 键写进 `supports`: 四个已被 #4634 退役并 tombstone 为 `never`(transactions/joins/streaming/ fullTextSearch),另外五个从来就不是 `DriverCapabilitiesSchema` 的键 (aggregations/bulkOperations/nestedObjects/geoQueries/changeStreams)。 没有任何读者,唯一效果是被下一个照抄 mock 的作者复制。 `DriverCapabilities` 的每一位都是 optional,所以空广告即合法广告 (spec 侧 driver.test.ts 已有 `supports: {}` 的对照用例)。 Claude-Session: https://claude.ai/code/session_01KDU3qAuJyajAQm3GkUXdfA Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent d4df105 commit 02479cc

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

packages/metadata/src/loaders/database-loader.test.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,16 @@ function createMockDriver(): IDataDriver {
3737
return {
3838
name: 'mock',
3939
version: '1.0.0',
40-
supports: {
41-
transactions: false,
42-
joins: false,
43-
aggregations: false,
44-
streaming: false,
45-
bulkOperations: true,
46-
nestedObjects: false,
47-
fullTextSearch: false,
48-
geoQueries: false,
49-
changeStreams: false,
50-
},
40+
// An empty advertisement is a legal advertisement: every bit in
41+
// `DriverCapabilities` is optional, and this mock needs none of the three
42+
// that survive (#4782). The block used to spell nine — four RETIRED by
43+
// #4634 (`transactions`/`joins`/`streaming`/`fullTextSearch`, now
44+
// tombstoned as `never`) and five that were never keys of
45+
// `DriverCapabilitiesSchema` at all (`aggregations`/`bulkOperations`/
46+
// `nestedObjects`/`geoQueries`/`changeStreams`). Nothing here read any of
47+
// them; their only effect was to be copied into the next mock. Capability
48+
// is METHOD presence, not a boolean — do not re-add bits here.
49+
supports: {},
5150

5251
connect: vi.fn().mockResolvedValue(undefined),
5352
disconnect: vi.fn().mockResolvedValue(undefined),

0 commit comments

Comments
 (0)