@@ -263,27 +263,35 @@ describe('workerpool', () => {
263263 } ) ;
264264
265265 describe ( 'on networks relying on compass' , ( ) => {
266- // TODO include compass in stack instead of using arbitrum-sepolia-testnet
266+ const noEnsTestChain = TEST_CHAINS [ 'custom-token-chain-no-ens' ] ;
267+
267268 test ( 'resolves the url against Compass' , async ( ) => {
268- const readOnlyIExec = new IExec (
269- { ethProvider : 'arbitrum-sepolia-testnet' } ,
270- { allowExperimentalNetworks : true } ,
271- ) ;
269+ const { iexec : readOnlyIExec } = getTestConfig ( noEnsTestChain ) ( ) ;
272270 const apiUrl = await readOnlyIExec . workerpool . getWorkerpoolApiUrl (
273271 '0xB967057a21dc6A66A29721d96b8Aa7454B7c383F' ,
274272 ) ;
275273 expect ( typeof apiUrl ) . toBe ( 'string' ) ;
276274 expect ( apiUrl . startsWith ( 'https://' ) ) . toBe ( true ) ;
277275 } ) ;
278276
277+ test ( 'throw if the workerpool does not exist in Compass' , async ( ) => {
278+ const { iexec : readOnlyIExec } = getTestConfig ( noEnsTestChain ) ( ) ;
279+ const address = getRandomAddress ( ) ;
280+ await expect (
281+ readOnlyIExec . workerpool . getWorkerpoolApiUrl ( address ) ,
282+ ) . rejects . toThrow (
283+ Error (
284+ `API error: Workerpool with address '${ address } ' not found in chain '${ noEnsTestChain . chainId } '` ,
285+ ) ,
286+ ) ;
287+ } ) ;
288+
279289 test ( 'fails with CompassCallError if Compass is not available' , async ( ) => {
280- const iexecCompassNotFound = new IExec (
281- { ethProvider : 'arbitrum-sepolia-testnet' } ,
282- {
283- allowExperimentalNetworks : true ,
290+ const { iexec : iexecCompassNotFound } = getTestConfig ( noEnsTestChain ) ( {
291+ options : {
284292 compassURL : SERVICE_UNREACHABLE_URL ,
285293 } ,
286- ) ;
294+ } ) ;
287295 await expect (
288296 iexecCompassNotFound . workerpool . getWorkerpoolApiUrl (
289297 getRandomAddress ( ) ,
@@ -294,10 +302,13 @@ describe('workerpool', () => {
294302 ) ,
295303 ) ;
296304
297- const iexecCompassInternalError = new IExec (
298- { ethProvider : 'arbitrum-sepolia-testnet' } ,
299- { allowExperimentalNetworks : true , compassURL : SERVICE_HTTP_500_URL } ,
300- ) ;
305+ const { iexec : iexecCompassInternalError } = getTestConfig (
306+ noEnsTestChain ,
307+ ) ( {
308+ options : {
309+ compassURL : SERVICE_HTTP_500_URL ,
310+ } ,
311+ } ) ;
301312 await expect (
302313 iexecCompassInternalError . workerpool . getWorkerpoolApiUrl (
303314 getRandomAddress ( ) ,
0 commit comments