Skip to content

Commit 3715416

Browse files
committed
Add test
1 parent c22af28 commit 3715416

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/node/test/sdk/client.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,18 @@ describe('NodeClient', () => {
129129
expect(event.server_name).toEqual(os.hostname());
130130
});
131131

132+
test('does not add hostname when includeServerName = false', () => {
133+
const options = getDefaultNodeClientOptions({});
134+
options.includeServerName = false;
135+
const client = new NodeClient(options);
136+
137+
const event: Event = {};
138+
const hint: EventHint = {};
139+
client['_prepareEvent'](event, hint, currentScope, isolationScope);
140+
141+
expect(event.server_name).toBeUndefined();
142+
});
143+
132144
test("doesn't clobber existing runtime data", () => {
133145
const options = getDefaultNodeClientOptions({ serverName: 'bar' });
134146
const client = new NodeClient(options);

0 commit comments

Comments
 (0)