How to use the dd-trace/packages/dd-trace/src/opentracing/span_context.mockClear function in dd-trace

To help you get started, we’ve selected a few dd-trace 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 / datadog.spec.js View on Github external
it("should convert normal span to Datadog span with parentID, env & logs", () => {
			exporter.ddTracer.startSpan.mockClear();
			fakeDdSpan.context.mockClear();
			fakeDdSpan.setTag.mockClear();
			DatadogSpanContext.mockClear();
			exporter.convertID = jest.fn(id => id);
			exporter.opts.env = "testing";

			const fakeOldSpan = { name: "old-span" };
			fakeTracerScope._spans[asyncHooks.executionAsyncId()] = fakeOldSpan;

			const span = {
				name: "Test Span",
				type: "action",
				id: "aaa-12345678901234567890",
				traceID: "bbb-12345678901234567890",
				parentID: "ccc-12345678901234567890",

				service: {
					fullName: "v1.posts"
				},