-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathtest.ts
More file actions
33 lines (30 loc) · 974 Bytes
/
test.ts
File metadata and controls
33 lines (30 loc) · 974 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
27
28
29
30
31
32
33
import { _INTERNAL_MAX_FLAGS_PER_SPAN as MAX_FLAGS_PER_SPAN } from '@sentry/core';
import { afterAll, expect, test } from 'vitest';
import { cleanupChildProcesses, createRunner } from '../../../../utils/runner';
afterAll(() => {
cleanupChildProcesses();
});
test('Flags captured on span attributes with max limit', async () => {
// Based on scenario.ts.
const expectedFlags: Record<string, boolean> = {};
for (let i = 1; i <= MAX_FLAGS_PER_SPAN; i++) {
expectedFlags[`flag.evaluation.feat${i}`] = i === 3;
}
await createRunner(__dirname, 'scenario.ts')
.expect({
transaction: {
spans: [
expect.objectContaining({
description: 'test-span',
data: expect.objectContaining({}),
}),
expect.objectContaining({
description: 'test-nested-span',
data: expect.objectContaining(expectedFlags),
}),
],
},
})
.start()
.completed();
});