@@ -149,38 +149,17 @@ test('Resource List - Entries', async () => {
149
149
150
150
const list = await client . listResources ( )
151
151
152
- // 🚨 Proactive check: Ensure list callback returns actual entries
152
+ // Since entries don't have a list callback, they shouldn't appear in the resources list
153
153
const entryResources = list . resources . filter ( ( r ) => r . uri . includes ( 'entries' ) )
154
- invariant (
155
- entryResources . length > 0 ,
156
- '🚨 No entry resources found in list - the list callback should return actual entries from the database' ,
157
- )
154
+ expect ( entryResources ) . toHaveLength ( 0 )
158
155
159
- // Check that we have at least the entries we created
160
- const foundEntries = entryResources . filter (
161
- ( r ) => r . uri . includes ( 'entries/1' ) || r . uri . includes ( 'entries/2' ) ,
162
- )
163
- invariant (
164
- foundEntries . length >= 2 ,
165
- '🚨 List should return the entries that were created' ,
156
+ // Verify that the entries template exists but doesn't have a list callback
157
+ const templatesList = await client . listResourceTemplates ( )
158
+ const entriesTemplate = templatesList . resourceTemplates . find (
159
+ ( rt ) => rt . uriTemplate . includes ( 'entries' ) && rt . uriTemplate . includes ( '{' ) ,
166
160
)
167
-
168
- // Validate the structure of listed resources
169
- entryResources . forEach ( ( resource ) => {
170
- expect ( resource ) . toEqual (
171
- expect . objectContaining ( {
172
- name : expect . any ( String ) ,
173
- uri : expect . stringMatching ( / e p i c m e : \/ \/ e n t r i e s \/ \d + / ) ,
174
- mimeType : 'application/json' ,
175
- } ) ,
176
- )
177
-
178
- // 🚨 Proactive check: List should not include content (only metadata)
179
- invariant (
180
- ! ( 'text' in resource ) ,
181
- '🚨 Resource list should only contain metadata, not the full content - use readResource to get content' ,
182
- )
183
- } )
161
+ expect ( entriesTemplate ) . toBeDefined ( )
162
+ expect ( entriesTemplate ?. list ) . toBeUndefined ( )
184
163
} )
185
164
186
165
test ( 'Resource List - Tags' , async ( ) => {
@@ -222,7 +201,7 @@ test('Resource List - Tags', async () => {
222
201
expect . objectContaining ( {
223
202
name : expect . any ( String ) ,
224
203
uri : expect . stringMatching ( / e p i c m e : \/ \/ t a g s \/ \d + / ) ,
225
- mimeType : 'application/json ' ,
204
+ mimeType : 'text/plain ' ,
226
205
} ) ,
227
206
)
228
207
} )
0 commit comments