import { P2P , errors } from '../../src/index' ; import { createNetwork , destroyNetwork } from '../utils/network_setup' ; describe ( 'Unseeded network: Each node has an empty seedPeers list' , ( ) => { let p2pNodeList = [ ] ; beforeEach ( async ( ) => { const customConfig = ( ) => ( { seedPeers : [ ] , fixedPeers : [ ] , } ) ; p2pNodeList = await createNetwork ( { customConfig } ) ; } ) ; afterEach ( async ( ) => { await destroyNetwork ( p2pNodeList ) ; } ) ; it ( 'should set the isActive property to true for all nodes' , ( ) => { for ( const p2p of p2pNodeList ) { expect ( p2p ) . toHaveProperty ( 'isActive' , true ) ; } } ) ; it ( 'should throw an error when attempting to make a request' , async ( ) => { const firstP2PNode = p2pNodeList [ 0 ] ; const response = firstP2PNode . request ( { procedure : 'foo' , data : 'bar' , } ) ; return expect ( response ) . rejects . toThrow ( errors . RequestFailError ) ; } ) ; } ) ;