import '../../setup' ; import { SimpleServer } from '../../../src/app/transport/server' ; import { SimpleClient } from '../../../src/app/transport/client' ; describe ( 'Simple JSON RPC Server' , ( ) => { it ( 'should send a request to a server and then respond' , async ( ) => { const greeter = ( name ) => { return 'Hello ' + name ; } ; const server = new SimpleServer ( { greeter , } , 'localhost' , 3000 ) ; await server . listen ( ) ; const client = new SimpleClient ( 'http://127.0.0.1:3000' ) ; const res = await client . handle ( 'greeter' , 'World!' ) ; res . should . equal ( 'Hello World!' ) ; await server . close ( ) ; } ) ; } ) ;