@opentelemetry/propagation-utils 0.29.0 → 0.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -18,11 +18,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
const pubsub_propagation_1 = require("../src/pubsub-propagation");
|
|
19
19
|
const contrib_test_utils_1 = require("@opentelemetry/contrib-test-utils");
|
|
20
20
|
const api_1 = require("@opentelemetry/api");
|
|
21
|
-
const
|
|
22
|
-
contrib_test_utils_1.registerInstrumentationTestingProvider();
|
|
21
|
+
const expect_1 = require("expect");
|
|
22
|
+
(0, contrib_test_utils_1.registerInstrumentationTestingProvider)();
|
|
23
23
|
const tracer = api_1.trace.getTracer('test');
|
|
24
24
|
afterEach(() => {
|
|
25
|
-
contrib_test_utils_1.resetMemoryExporter();
|
|
25
|
+
(0, contrib_test_utils_1.resetMemoryExporter)();
|
|
26
26
|
});
|
|
27
27
|
describe('Pubsub propagation', () => {
|
|
28
28
|
it('Span ends immediately when the function returns a non-promise', () => {
|
|
@@ -38,10 +38,10 @@ describe('Pubsub propagation', () => {
|
|
|
38
38
|
}),
|
|
39
39
|
});
|
|
40
40
|
pubsub_propagation_1.default.patchArrayForProcessSpans(messages, tracer, api_1.ROOT_CONTEXT);
|
|
41
|
-
expect(contrib_test_utils_1.getTestSpans().length).toBe(0);
|
|
41
|
+
(0, expect_1.expect)((0, contrib_test_utils_1.getTestSpans)().length).toBe(0);
|
|
42
42
|
messages.map(x => x);
|
|
43
|
-
expect(contrib_test_utils_1.getTestSpans().length).toBe(1);
|
|
44
|
-
expect(contrib_test_utils_1.getTestSpans()[0]).toMatchObject({ name: 'test process' });
|
|
43
|
+
(0, expect_1.expect)((0, contrib_test_utils_1.getTestSpans)().length).toBe(1);
|
|
44
|
+
(0, expect_1.expect)((0, contrib_test_utils_1.getTestSpans)()[0]).toMatchObject({ name: 'test process' });
|
|
45
45
|
});
|
|
46
46
|
it('Span ends on promise-resolution', () => {
|
|
47
47
|
const messages = [{}];
|
|
@@ -56,19 +56,19 @@ describe('Pubsub propagation', () => {
|
|
|
56
56
|
}),
|
|
57
57
|
});
|
|
58
58
|
pubsub_propagation_1.default.patchArrayForProcessSpans(messages, tracer, api_1.ROOT_CONTEXT);
|
|
59
|
-
expect(contrib_test_utils_1.getTestSpans().length).toBe(0);
|
|
59
|
+
(0, expect_1.expect)((0, contrib_test_utils_1.getTestSpans)().length).toBe(0);
|
|
60
60
|
let resolve;
|
|
61
61
|
messages.map(() => new Promise(res => {
|
|
62
62
|
resolve = res;
|
|
63
63
|
}));
|
|
64
|
-
expect(contrib_test_utils_1.getTestSpans().length).toBe(0);
|
|
64
|
+
(0, expect_1.expect)((0, contrib_test_utils_1.getTestSpans)().length).toBe(0);
|
|
65
65
|
// @ts-expect-error Typescript thinks this value is used before assignment
|
|
66
66
|
resolve(undefined);
|
|
67
67
|
// We use setTimeout here to make sure our assertations run
|
|
68
68
|
// after the promise resolves
|
|
69
69
|
return new Promise(res => setTimeout(res, 0)).then(() => {
|
|
70
|
-
expect(contrib_test_utils_1.getTestSpans().length).toBe(1);
|
|
71
|
-
expect(contrib_test_utils_1.getTestSpans()[0]).toMatchObject({ name: 'test process' });
|
|
70
|
+
(0, expect_1.expect)((0, contrib_test_utils_1.getTestSpans)().length).toBe(1);
|
|
71
|
+
(0, expect_1.expect)((0, contrib_test_utils_1.getTestSpans)()[0]).toMatchObject({ name: 'test process' });
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
74
|
it('Span ends on promise-rejection', () => {
|
|
@@ -84,19 +84,19 @@ describe('Pubsub propagation', () => {
|
|
|
84
84
|
}),
|
|
85
85
|
});
|
|
86
86
|
pubsub_propagation_1.default.patchArrayForProcessSpans(messages, tracer, api_1.ROOT_CONTEXT);
|
|
87
|
-
expect(contrib_test_utils_1.getTestSpans().length).toBe(0);
|
|
87
|
+
(0, expect_1.expect)((0, contrib_test_utils_1.getTestSpans)().length).toBe(0);
|
|
88
88
|
let reject;
|
|
89
89
|
messages.map(() => new Promise((_, rej) => {
|
|
90
90
|
reject = rej;
|
|
91
91
|
}));
|
|
92
|
-
expect(contrib_test_utils_1.getTestSpans().length).toBe(0);
|
|
92
|
+
(0, expect_1.expect)((0, contrib_test_utils_1.getTestSpans)().length).toBe(0);
|
|
93
93
|
// @ts-expect-error Typescript thinks this value is used before assignment
|
|
94
94
|
reject(new Error('Failed'));
|
|
95
95
|
// We use setTimeout here to make sure our assertations run
|
|
96
96
|
// after the promise resolves
|
|
97
97
|
return new Promise(res => setTimeout(res, 0)).then(() => {
|
|
98
|
-
expect(contrib_test_utils_1.getTestSpans().length).toBe(1);
|
|
99
|
-
expect(contrib_test_utils_1.getTestSpans()[0]).toMatchObject({ name: 'test process' });
|
|
98
|
+
(0, expect_1.expect)((0, contrib_test_utils_1.getTestSpans)().length).toBe(1);
|
|
99
|
+
(0, expect_1.expect)((0, contrib_test_utils_1.getTestSpans)()[0]).toMatchObject({ name: 'test process' });
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
102
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pubsub-propagation.test.js","sourceRoot":"","sources":["../../test/pubsub-propagation.test.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;GAcG;AACH,kEAA8C;AAC9C,0EAI2C;AAC3C,4CAAyD;AACzD,
|
|
1
|
+
{"version":3,"file":"pubsub-propagation.test.js","sourceRoot":"","sources":["../../test/pubsub-propagation.test.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;GAcG;AACH,kEAA8C;AAC9C,0EAI2C;AAC3C,4CAAyD;AACzD,mCAAgC;AAEhC,IAAA,2DAAsC,GAAE,CAAC;AAEzC,MAAM,MAAM,GAAG,WAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAEvC,SAAS,CAAC,GAAG,EAAE;IACb,IAAA,wCAAmB,GAAE,CAAC;AACxB,CAAC,CAAC,CAAC;AAEH,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K,CAAC,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,kBAAY,CAAC,CAAC;QAEhE,IAAA,eAAM,EAAC,IAAA,iCAAY,GAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAEtC,IAAI,MAAgC,CAAC;QAErC,QAAQ,CAAC,GAAG,CACV,GAAG,EAAE,CACH,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;YACrB,MAAM,GAAG,GAAG,CAAC;QACf,CAAC,CAAC,CACL,CAAC;QAEF,IAAA,eAAM,EAAC,IAAA,iCAAY,GAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAEtC,0EAA0E;QAC1E,MAAM,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;QAE5B,2DAA2D;QAC3D,6BAA6B;QAC7B,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YACtD,IAAA,eAAM,EAAC,IAAA,iCAAY,GAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACtC,IAAA,eAAM,EAAC,IAAA,iCAAY,GAAE,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentelemetry/propagation-utils",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.2",
|
|
4
4
|
"description": "Propagation utilities for opentelemetry instrumentations",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"types": "build/src/index.d.ts",
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@opentelemetry/api": "^1.0.0",
|
|
48
|
-
"@opentelemetry/contrib-test-utils": "^0.
|
|
48
|
+
"@opentelemetry/contrib-test-utils": "^0.33.1",
|
|
49
49
|
"@types/mocha": "^9.1.1",
|
|
50
|
-
"@types/node": "
|
|
50
|
+
"@types/node": "18.11.7",
|
|
51
51
|
"@types/sinon": "^10.0.11",
|
|
52
|
-
"expect": "
|
|
52
|
+
"expect": "29.2.0",
|
|
53
53
|
"gts": "3.1.0",
|
|
54
54
|
"mocha": "7.2.0",
|
|
55
55
|
"nyc": "15.1.0",
|
|
56
|
-
"sinon": "
|
|
56
|
+
"sinon": "15.0.1",
|
|
57
57
|
"ts-mocha": "10.0.0",
|
|
58
|
-
"typescript": "4.
|
|
58
|
+
"typescript": "4.4.4"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "63e0fc9b6b862f74304abf0343c506a5bd415191"
|
|
61
61
|
}
|