11import type { ExecutionContext } from '@cloudflare/workers-types' ;
22import * as SentryCore from '@sentry/core' ;
3- import { afterEach , describe , expect , it , onTestFinished , vi } from 'vitest' ;
4- import { isInstrumented } from '../../src/instrument' ;
3+ import { afterEach , describe , expect , it , vi } from 'vitest' ;
4+ import { getInstrumented } from '../../src/instrument' ;
55import {
66 instrumentWorkerEntrypoint ,
77 type WorkerEntrypointConstructor ,
@@ -122,8 +122,8 @@ describe('instrumentWorkerEntrypoint', () => {
122122 ) ;
123123 const obj = Reflect . construct ( instrumented , [ mockContext , mockEnv ] ) ;
124124
125- expect ( isInstrumented ( obj . ctx ) ) . toBeFalsy ( ) ;
126- expect ( isInstrumented ( obj . env ) ) . toBeFalsy ( ) ;
125+ expect ( getInstrumented ( obj . ctx ) ) . toBeFalsy ( ) ;
126+ expect ( getInstrumented ( obj . env ) ) . toBeFalsy ( ) ;
127127 } ) ;
128128
129129 it ( 'Overrides obj.ctx with instrumented context so user code using this.ctx.waitUntil works' , async ( ) => {
@@ -246,7 +246,7 @@ describe('instrumentWorkerEntrypoint', () => {
246246 const instrumented = instrumentWorkerEntrypoint ( options , TestClass as unknown as WorkerEntrypointConstructor ) ;
247247 const obj = Reflect . construct ( instrumented , [ ] ) ;
248248
249- expect ( isInstrumented ( obj . prototypeMethod ) ) . toBeFalsy ( ) ;
249+ expect ( getInstrumented ( obj . prototypeMethod ) ) . toBeFalsy ( ) ;
250250 } ) ;
251251
252252 it ( 'does not instrument prototype methods when option is false' , ( ) => {
@@ -259,7 +259,7 @@ describe('instrumentWorkerEntrypoint', () => {
259259 const instrumented = instrumentWorkerEntrypoint ( options , TestClass as unknown as WorkerEntrypointConstructor ) ;
260260 const obj = Reflect . construct ( instrumented , [ ] ) ;
261261
262- expect ( isInstrumented ( obj . prototypeMethod ) ) . toBeFalsy ( ) ;
262+ expect ( getInstrumented ( obj . prototypeMethod ) ) . toBeFalsy ( ) ;
263263 } ) ;
264264
265265 it ( 'does not instrument prototype methods when option is true (instrumentWorkerEntrypoint does not support instrumentPrototypeMethods)' , ( ) => {
@@ -275,8 +275,8 @@ describe('instrumentWorkerEntrypoint', () => {
275275 const instrumented = instrumentWorkerEntrypoint ( options , TestClass as unknown as WorkerEntrypointConstructor ) ;
276276 const obj = Reflect . construct ( instrumented , [ createMockExecutionContext ( ) , { } ] ) ;
277277
278- expect ( isInstrumented ( obj . methodOne ) ) . toBeFalsy ( ) ;
279- expect ( isInstrumented ( obj . methodTwo ) ) . toBeFalsy ( ) ;
278+ expect ( getInstrumented ( obj . methodOne ) ) . toBeFalsy ( ) ;
279+ expect ( getInstrumented ( obj . methodTwo ) ) . toBeFalsy ( ) ;
280280 expect ( obj . methodOne ( ) ) . toBe ( 'one' ) ;
281281 expect ( obj . methodTwo ( ) ) . toBe ( 'two' ) ;
282282 } ) ;
0 commit comments