File tree Expand file tree Collapse file tree 3 files changed +6
-15
lines changed
dev-packages/browser-integration-tests/suites/tracing/ai-providers Expand file tree Collapse file tree 3 files changed +6
-15
lines changed Original file line number Diff line number Diff line change 1- import * as Sentry from '@sentry/browser' ;
1+ import { instrumentAnthropicAiClient } from '@sentry/browser' ;
22import { MockAnthropic } from './mocks.js' ;
33
44const mockClient = new MockAnthropic ( {
55 apiKey : 'mock-api-key' ,
66} ) ;
77
8- const client = Sentry . instrumentAnthropicAiClient ( mockClient ) ;
8+ const client = instrumentAnthropicAiClient ( mockClient ) ;
99
1010// Test that manual instrumentation doesn't crash the browser
1111// The instrumentation automatically creates spans
@@ -17,6 +17,3 @@ const response = await client.messages.create({
1717} ) ;
1818
1919console . log ( "Received response" , response )
20-
21- // Ensure transaction is flushed in CI
22- await Sentry . flush ( 2000 ) ;
Original file line number Diff line number Diff line change 1- import * as Sentry from '@sentry/browser' ;
1+ import { instrumentGoogleGenAIClient } from '@sentry/browser' ;
22import { MockGoogleGenAI } from './mocks.js' ;
33
44const mockClient = new MockGoogleGenAI ( {
55 apiKey : 'mock-api-key' ,
66} ) ;
77
8- const client = Sentry . instrumentGoogleGenAIClient ( mockClient ) ;
8+ const client = instrumentGoogleGenAIClient ( mockClient ) ;
99
1010// Test that manual instrumentation doesn't crash the browser
1111// The instrumentation automatically creates spans
@@ -30,6 +30,3 @@ const response = await chat.sendMessage({
3030} ) ;
3131
3232console . log ( "Received response" , response )
33-
34- // Ensure transaction is flushed in CI
35- await Sentry . flush ( 2000 ) ;
Original file line number Diff line number Diff line change 1- import * as Sentry from '@sentry/browser' ;
1+ import { instrumentOpenAiClient } from '@sentry/browser' ;
22import { MockOpenAi } from './mocks.js' ;
33
44const mockClient = new MockOpenAi ( {
55 apiKey : 'mock-api-key' ,
66} ) ;
77
8- const client = Sentry . instrumentOpenAiClient ( mockClient ) ;
8+ const client = instrumentOpenAiClient ( mockClient ) ;
99
1010// Test that manual instrumentation doesn't crash the browser
1111// The instrumentation automatically creates spans
@@ -20,6 +20,3 @@ const response = await client.chat.completions.create({
2020} ) ;
2121
2222console . log ( "Received response" , response )
23-
24- // Ensure transaction is flushed in CI
25- await Sentry . flush ( 2000 ) ;
You can’t perform that action at this time.
0 commit comments