-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest.js
More file actions
26 lines (25 loc) · 802 Bytes
/
test.js
File metadata and controls
26 lines (25 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc.
**/
const { foo, bar } = require('./instrumented.js');
const { assert, getContext } = require('../common/preamble.js');
const context = getContext('orchestrion:undici:method_call');
(async () => {
const result = await foo();
assert.strictEqual(result, 'foo');
assert.deepStrictEqual(context, {
start: true,
end: true,
asyncStart: 'foo',
asyncEnd: 'foo'
});
const result2 = await bar();
assert.strictEqual(result2, 'bar');
assert.deepStrictEqual(context, {
start: true,
end: true,
asyncStart: 'bar',
asyncEnd: 'bar'
});
})();