describe('JsonEncoder', () => { it('should have correct type', () => { const v1: JsonEncoder = jsonEncoder.JSON_V1; const v2: JsonEncoder = jsonEncoder.JSON_V2; const span: model.Span = new model.Span(new TraceId({ spanId: 'xyz' })); expect(v1.encode(span)).to.be.a('string'); expect(v2.encode(span)).to.be.a('string'); }); });
describe('Model', () => { describe('Endpoint', () => { it('should have correct type', () => { const endpoint: model.Endpoint = new model.Endpoint({ serviceName: 'Unknown', ipv4: '10.0.0.1', port: 8000 }); expect(endpoint.setIpv4).to.be.a('function'); }); }); describe('Span', () => { it('should have correct type', () => { const span: model.Span = new model.Span(new TraceId({ traceId: 'a', spanId: 'b' })); expect(span.traceId).to.be.a('string'); }); }); });
describe('JsonEncoder', () => { it('should have correct type', () => { const v1: JsonEncoder = jsonEncoder.JSON_V1; const v2: JsonEncoder = jsonEncoder.JSON_V2; const span: model.Span = new model.Span(new TraceId({ spanId: 'xyz' })); expect(v1.encode(span)).to.be.a('string'); expect(v2.encode(span)).to.be.a('string'); }); });
describe('Model', () => { describe('Endpoint', () => { it('should have correct type', () => { const endpoint: model.Endpoint = new model.Endpoint({ serviceName: 'Unknown', ipv4: '10.0.0.1', port: 8000 }); expect(endpoint.setIpv4).to.be.a('function'); }); }); describe('Span', () => { it('should have correct type', () => { const span: model.Span = new model.Span(new TraceId({ traceId: 'a', spanId: 'b' })); expect(span.traceId).to.be.a('string'); }); }); });