@@ -3,20 +3,21 @@ import { EventEmitter } from 'events';
33import type { Transport } from '@sentry/core' ;
44
55import type { NodeClient } from '@sentry/node' ;
6+ import { afterEach , describe , expect , it , vi } from 'vitest' ;
67import { _nodeProfilingIntegration } from '../src/integration' ;
78
89describe ( 'ProfilingIntegration' , ( ) => {
910 afterEach ( ( ) => {
10- jest . clearAllMocks ( ) ;
11+ vi . clearAllMocks ( ) ;
1112 } ) ;
1213 it ( 'has a name' , ( ) => {
1314 expect ( _nodeProfilingIntegration ( ) . name ) . toBe ( 'ProfilingIntegration' ) ;
1415 } ) ;
1516
1617 it ( 'does not call transporter if null profile is received' , ( ) => {
1718 const transport : Transport = {
18- send : jest . fn ( ) . mockImplementation ( ( ) => Promise . resolve ( ) ) ,
19- flush : jest . fn ( ) . mockImplementation ( ( ) => Promise . resolve ( ) ) ,
19+ send : vi . fn ( ) . mockImplementation ( ( ) => Promise . resolve ( ) ) ,
20+ flush : vi . fn ( ) . mockImplementation ( ( ) => Promise . resolve ( ) ) ,
2021 } ;
2122 const integration = _nodeProfilingIntegration ( ) ;
2223 const emitter = new EventEmitter ( ) ;
@@ -43,14 +44,14 @@ describe('ProfilingIntegration', () => {
4344
4445 it ( 'binds to spanStart, spanEnd and beforeEnvelope' , ( ) => {
4546 const transport : Transport = {
46- send : jest . fn ( ) . mockImplementation ( ( ) => Promise . resolve ( ) ) ,
47- flush : jest . fn ( ) . mockImplementation ( ( ) => Promise . resolve ( ) ) ,
47+ send : vi . fn ( ) . mockImplementation ( ( ) => Promise . resolve ( ) ) ,
48+ flush : vi . fn ( ) . mockImplementation ( ( ) => Promise . resolve ( ) ) ,
4849 } ;
4950 const integration = _nodeProfilingIntegration ( ) ;
5051
5152 const client = {
52- on : jest . fn ( ) ,
53- emit : jest . fn ( ) ,
53+ on : vi . fn ( ) ,
54+ emit : vi . fn ( ) ,
5455 getOptions : ( ) => {
5556 return {
5657 _metadata : { } ,
@@ -63,7 +64,7 @@ describe('ProfilingIntegration', () => {
6364 getTransport : ( ) => transport ,
6465 } as unknown as NodeClient ;
6566
66- const spy = jest . spyOn ( client , 'on' ) ;
67+ const spy = vi . spyOn ( client , 'on' ) ;
6768
6869 integration ?. setup ?.( client ) ;
6970
0 commit comments