@@ -80,9 +80,7 @@ describe('Perplexity Integration Tests', () => {
8080 this . timeout ( 30000 ) ;
8181
8282 const result = await agentContextStorage . run ( mockAgentContext , async ( ) => {
83- return await perplexity . search ( 'TypeScript 5.9 features' , {
84- max_results : 5 ,
85- } ) ;
83+ return await perplexity . webSearch ( 'TypeScript 5.9 features' ) ;
8684 } ) ;
8785
8886 expect ( result ) . to . have . property ( 'results' ) ;
@@ -101,40 +99,7 @@ describe('Perplexity Integration Tests', () => {
10199 this . timeout ( 30000 ) ;
102100
103101 const result = await agentContextStorage . run ( mockAgentContext , async ( ) => {
104- return await perplexity . search ( [ 'Node.js performance' , 'JavaScript async patterns' ] , {
105- max_results : 10 ,
106- } ) ;
107- } ) ;
108-
109- expect ( result . results ) . to . be . an ( 'array' ) ;
110- expect ( result . results . length ) . to . be . greaterThan ( 0 ) ;
111- } ) ;
112-
113- it ( 'should return snippets when requested' , async function ( ) {
114- this . timeout ( 30000 ) ;
115-
116- const result = await agentContextStorage . run ( mockAgentContext , async ( ) => {
117- return await perplexity . search ( 'React best practices 2025' , {
118- max_results : 3 ,
119- return_snippets : true ,
120- } ) ;
121- } ) ;
122-
123- expect ( result . results ) . to . be . an ( 'array' ) ;
124- expect ( result . results . length ) . to . be . greaterThan ( 0 ) ;
125-
126- const resultsWithSnippets = result . results . filter ( ( r ) => r . snippet ) ;
127- expect ( resultsWithSnippets . length ) . to . be . greaterThan ( 0 ) ;
128- } ) ;
129-
130- it ( 'should support country filtering' , async function ( ) {
131- this . timeout ( 30000 ) ;
132-
133- const result = await agentContextStorage . run ( mockAgentContext , async ( ) => {
134- return await perplexity . search ( 'local tech events' , {
135- max_results : 5 ,
136- country : 'US' ,
137- } ) ;
102+ return await perplexity . webSearch ( [ 'Node.js performance' , 'JavaScript async patterns' ] ) ;
138103 } ) ;
139104
140105 expect ( result . results ) . to . be . an ( 'array' ) ;
@@ -146,9 +111,7 @@ describe('Perplexity Integration Tests', () => {
146111
147112 await agentContextStorage . run ( mockAgentContext , async ( ) => {
148113 try {
149- await perplexity . search ( '' , {
150- max_results : 5 ,
151- } ) ;
114+ await perplexity . webSearch ( '' ) ;
152115 expect . fail ( 'Should have thrown an error' ) ;
153116 } catch ( error ) {
154117 expect ( error ) . to . exist ;
0 commit comments