(name: string)
| 253 | describe('auto lifecycle ending strategy', () => { |
| 254 | // Returns a channel whose span we can observe, plus spies for `span.end` and `captureException`. |
| 255 | function setup(name: string): { |
| 256 | channel: ReturnType<typeof bindTracingChannelToSpan>['channel']; |
| 257 | span: Span; |
| 258 | endSpy: ReturnType<typeof vi.spyOn>; |
| 259 | captureExceptionSpy: ReturnType<typeof vi.spyOn>; |
| 260 | } { |
| 261 | installTestAsyncContextStrategy(); |
| 262 | initTestClient(); |
| 263 | const span = startInactiveSpan({ name: 'channel-span' }); |
| 264 | const endSpy = vi.spyOn(span, 'end'); |
| 265 | const captureExceptionSpy = vi.spyOn(SentryCore, 'captureException').mockReturnValue('event-id'); |
| 266 | const { channel } = bindTracingChannelToSpan(tracingChannel<{ operation: string }>(name), () => span); |
| 267 | return { channel, span, endSpy, captureExceptionSpy }; |
| 268 | } |
| 269 | |
| 270 | it('traceSync success: ends the span once on `end`', () => { |
| 271 | const { channel, span, endSpy, captureExceptionSpy } = setup('test:lifecycle:sync-ok'); |
no test coverage detected