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' ;
2
2
import { Hub , makeMain } from '@sentry/core' ;
3
3
import * as http from 'http' ;
4
- import { fetch } from 'undici' ;
4
+ import type { fetch as FetchType } from 'undici' ;
5
5
6
6
import { NodeClient } from '../../src/client' ;
7
7
import { Undici } from '../../src/integrations/undici' ;
@@ -11,9 +11,18 @@ import { conditionalTest } from '../utils';
11
11
const SENTRY_DSN = 'https://[email protected] /0' ;
12
12
13
13
let hub : Hub ;
14
+ let fetch : typeof FetchType ;
14
15
15
16
beforeAll ( async ( ) => {
16
17
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
+ }
17
26
} ) ;
18
27
19
28
const DEFAULT_OPTIONS = getDefaultNodeClientOptions ( {
You can’t perform that action at this time.
0 commit comments