// This doesn't eagerly reference the server URL, as it isn't available until "before all" constructor({ app, testTracer, routeBasedSpanName, addTag }) { this._app = app; this._testTracer = testTracer; this._routeBasedSpanName = routeBasedSpanName; this._addTag = addTag; this._localServiceName = testTracer.tracer().localEndpoint.serviceName; this._ipv4 = InetAddress.getLocalAddress().ipv4(); }
describe('[ClientAddr, ServerAddr, MessageAddr, LocalAddr]', () => { it('should return correct type', () => { const clientAddr: Annotation.ClientAddr = new Annotation.ClientAddr({ host: InetAddress.getLocalAddress(), port: 8000 }); const serverAddr: Annotation.ServerAddr = new Annotation.ServerAddr({ serviceName: 'name', host: InetAddress.getLocalAddress(), port: 8000 }); const MessageAddr: Annotation.MessageAddr = new Annotation.MessageAddr({ serviceName: 'name', host: InetAddress.getLocalAddress(), port: 8000 }); const localAddr: Annotation.LocalAddr = new Annotation.LocalAddr({ host: InetAddress.getLocalAddress(), port: 8000 }); expect(clientAddr).to.have.property('annotationType'); expect(serverAddr).to.have.property('serviceName'); expect(MessageAddr).to.have.property('serviceName'); expect(localAddr).to.have.property('host'); }); });
describe('[ClientAddr, ServerAddr, MessageAddr, LocalAddr]', () => { it('should return correct type', () => { const clientAddr: Annotation.ClientAddr = new Annotation.ClientAddr({ host: InetAddress.getLocalAddress(), port: 8000 }); const serverAddr: Annotation.ServerAddr = new Annotation.ServerAddr({ serviceName: 'name', host: InetAddress.getLocalAddress(), port: 8000 }); const MessageAddr: Annotation.MessageAddr = new Annotation.MessageAddr({ serviceName: 'name', host: InetAddress.getLocalAddress(), port: 8000 }); const localAddr: Annotation.LocalAddr = new Annotation.LocalAddr({ host: InetAddress.getLocalAddress(), port: 8000 }); expect(clientAddr).to.have.property('annotationType'); expect(serverAddr).to.have.property('serviceName'); expect(MessageAddr).to.have.property('serviceName'); expect(localAddr).to.have.property('host'); }); });