@@ -120,21 +120,25 @@ describe('PolymarketClient.getTokenPrice', () => {
120120describe ( 'PolymarketClient.searchMarkets' , ( ) => {
121121 it ( 'limits results to the requested count' , async ( ) => {
122122 const client = makeClient ( ) ;
123- client . getMarkets = async ( ) => [
123+ const mockMarkets = [
124124 { conditionId : '1' , question : 'Alpha market' , tokens : [ ] } ,
125125 { conditionId : '2' , question : 'Alpha second market' , tokens : [ ] } ,
126126 { conditionId : '3' , question : 'Alpha third market' , tokens : [ ] } ,
127127 ] ;
128+ client . getLiveMarkets = async ( ) => mockMarkets ;
129+ client . getMarkets = async ( ) => mockMarkets ;
128130
129131 const results = await client . searchMarkets ( 'alpha' , 2 ) ;
130132 expect ( results ) . toHaveLength ( 2 ) ;
131133 } ) ;
132134
133135 it ( 'is case-insensitive' , async ( ) => {
134136 const client = makeClient ( ) ;
135- client . getMarkets = async ( ) => [
137+ const mockMarkets = [
136138 { conditionId : '1' , question : 'IRAN sanctions threshold' , tokens : [ ] } ,
137139 ] ;
140+ client . getLiveMarkets = async ( ) => mockMarkets ;
141+ client . getMarkets = async ( ) => mockMarkets ;
138142
139143 await expect ( client . searchMarkets ( 'iran' , 10 ) ) . resolves . toHaveLength ( 1 ) ;
140144 await expect ( client . searchMarkets ( 'IRAN' , 10 ) ) . resolves . toHaveLength ( 1 ) ;
0 commit comments