@@ -103,8 +103,7 @@ export function createIntegrationTestsSuite(
103103 await client . close ( ) ;
104104 } ) ;
105105
106- // TODO: This test is not working as there is a problem with server reset, which loads default Actors
107- it . runIf ( false ) ( 'should list all default tools and two loaded Actors' , async ( ) => {
106+ it ( 'should list all default tools and two loaded Actors' , async ( ) => {
108107 const actors = [ 'apify/website-content-crawler' , 'apify/instagram-scraper' ] ;
109108 const client = await createClientFn ( { actors, enableAddingActors : false } ) ;
110109 const names = getToolNames ( await client . listTools ( ) ) ;
@@ -210,25 +209,27 @@ export function createIntegrationTestsSuite(
210209 } ) ;
211210
212211 it . runIf ( getActorsMcpServer ) ( 'should reset and restore tool state with default tools' , async ( ) => {
213- const client = await createClientFn ( { enableAddingActors : true } ) ;
212+ const firstClient = await createClientFn ( { enableAddingActors : true } ) ;
214213 const actorsMCPServer = getActorsMcpServer ! ( ) ;
215214 const numberOfTools = defaultTools . length + addRemoveTools . length + defaults . actors . length ;
216215 const toolList = actorsMCPServer . listAllToolNames ( ) ;
217216 expect ( toolList . length ) . toEqual ( numberOfTools ) ;
218217 // Add a new Actor
219- await addActor ( client , ACTOR_PYTHON_EXAMPLE ) ;
218+ await addActor ( firstClient , ACTOR_PYTHON_EXAMPLE ) ;
220219
221220 // Store the tool name list
222221 const toolListWithActor = actorsMCPServer . listAllToolNames ( ) ;
223222 expect ( toolListWithActor . length ) . toEqual ( numberOfTools + 1 ) ; // + 1 for the added Actor
223+ await firstClient . close ( ) ;
224224
225225 // Remove all tools
226- // TODO: The reset functions sets the enableAddingActors to false, which is not expected
227- // await actorsMCPServer.reset();
228- // const toolListAfterReset = actorsMCPServer.listAllToolNames();
229- // expect(toolListAfterReset.length).toEqual(numberOfTools);
230-
231- await client . close ( ) ;
226+ await actorsMCPServer . reset ( ) ;
227+ // We connect second client so that the default tools are loaded
228+ // if no specific list of Actors is provided
229+ const secondClient = await createClientFn ( { enableAddingActors : true } ) ;
230+ const toolListAfterReset = actorsMCPServer . listAllToolNames ( ) ;
231+ expect ( toolListAfterReset . length ) . toEqual ( numberOfTools ) ;
232+ await secondClient . close ( ) ;
232233 } ) ;
233234
234235 it . runIf ( getActorsMcpServer ) ( 'should notify tools changed handler on tool modifications' , async ( ) => {
0 commit comments