@@ -149,38 +149,17 @@ test('Resource List - Entries', async () => {
149149
150150 const list = await client . listResources ( )
151151
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
153153 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 )
158155
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 ( '{' ) ,
166160 )
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 ( )
184163} )
185164
186165test ( 'Resource List - Tags' , async ( ) => {
@@ -222,7 +201,7 @@ test('Resource List - Tags', async () => {
222201 expect . objectContaining ( {
223202 name : expect . any ( String ) ,
224203 uri : expect . stringMatching ( / e p i c m e : \/ \/ t a g s \/ \d + / ) ,
225- mimeType : 'application/json ' ,
204+ mimeType : 'text/plain ' ,
226205 } ) ,
227206 )
228207 } )
0 commit comments