Skip to content

Commit b2b9dcd

Browse files
committed
Use conventions constant in decide test assertions
1 parent 8bd99a6 commit b2b9dcd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/server-utils/test/integrations/vercel-ai/decide.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
2+
import { GEN_AI_OUTPUT_MESSAGES } from '@sentry/conventions/attributes';
23
import { GEN_AI_DECIDE } from '@sentry/conventions/op';
34
import { getMainCarrier, setCurrentClient, spanToStaticSpanJSON } from '@sentry/core';
45
import type { Span } from '@sentry/core';
@@ -51,7 +52,7 @@ describe('Vercel AI decide spans', () => {
5152
const json = spanToStaticSpanJSON(endedSpans[0]!);
5253
expect(json.description).toBe('decide typesafe-ai/jev');
5354
expect(json.op).toBe(GEN_AI_DECIDE);
54-
expect(JSON.parse(json.data?.['gen_ai.output.messages'] as string)).toEqual([
55+
expect(JSON.parse(json.data?.[GEN_AI_OUTPUT_MESSAGES] as string)).toEqual([
5556
{ type: 'evaluation', answers: { wantsRefund: { type: 'boolean', probability: 0.99 } } },
5657
]);
5758
});
@@ -78,7 +79,7 @@ describe('Vercel AI decide spans', () => {
7879
span.end();
7980

8081
const json = spanToStaticSpanJSON(endedSpans[0]!);
81-
expect(JSON.parse(json.data?.['gen_ai.output.messages'] as string)).toEqual([
82+
expect(JSON.parse(json.data?.[GEN_AI_OUTPUT_MESSAGES] as string)).toEqual([
8283
{ type: 'evaluation', answers: { department: { type: 'choice', choice: 'billing', confidence: 0.91 } } },
8384
]);
8485
});

0 commit comments

Comments
 (0)