File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
packages/node/test/integrations Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1- import { Transaction , getCurrentHub } from '@sentry/core' ;
1+ import type { Transaction } from '@sentry/core' ;
22import { Hub , makeMain } from '@sentry/core' ;
33import * as http from 'http' ;
4- import { fetch } from 'undici' ;
4+ import type { fetch as FetchType } from 'undici' ;
55
66import { NodeClient } from '../../src/client' ;
77import { Undici } from '../../src/integrations/undici' ;
@@ -11,9 +11,18 @@ import { conditionalTest } from '../utils';
1111const SENTRY_DSN = 'https://[email protected] /0' ; 1212
1313let hub : Hub ;
14+ let fetch : typeof FetchType ;
1415
1516beforeAll ( async ( ) => {
1617 await setupTestServer ( ) ;
18+ try {
19+ // need to conditionally require `undici` because it's not available in Node 10
20+ // eslint-disable-next-line @typescript-eslint/no-var-requires
21+ fetch = require ( 'undici' ) . fetch ;
22+ } catch ( e ) {
23+ // eslint-disable-next-line no-console
24+ console . warn ( 'Undici integration tests are skipped because undici is not installed.' ) ;
25+ }
1726} ) ;
1827
1928const DEFAULT_OPTIONS = getDefaultNodeClientOptions ( {
You can’t perform that action at this time.
0 commit comments