How to use the jaeger-client/dist/src/reporters/udp_sender.default.mockClear function in jaeger-client

To help you get started, we’ve selected a few jaeger-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github moleculerjs / moleculer / test / unit / tracing / exporters / jaeger.spec.js View on Github external
it("should create an HTTP sender", () => {
			UDPSender.mockClear();
			Jaeger.RemoteReporter.mockClear();

			const exporter = new JaegerTraceExporter({
				endpoint: "http://jaeger-host:9411"
			});
			exporter.init(fakeTracer);

			const res = exporter.getReporter();

			expect(res).toBe(fakeRemoteReporter);
			expect(HTTPSender).toHaveBeenCalledTimes(1);
			expect(HTTPSender).toHaveBeenCalledWith({ endpoint: "http://jaeger-host:9411" });

			expect(UDPSender).toHaveBeenCalledTimes(0);

			expect(Jaeger.RemoteReporter).toHaveBeenCalledTimes(1);