import { describe, it, expect } from 'vitest'; import * as exports from '../src/index'; describe('index exports', () => { describe('named exports', () => { it('should export init function', () => { expect(typeof exports.init).toBe('function'); }); it('should export getClient function', () => { expect(typeof exports.getClient).toBe('function'); }); it('should export captureException function', () => { expect(typeof exports.captureException).toBe('function'); }); it('should export captureMessage function', () => { expect(typeof exports.captureMessage).toBe('function'); }); it('should export captureEvent function', () => { expect(typeof exports.captureEvent).toBe('function'); }); it('should export setUser function', () => { expect(typeof exports.setUser).toBe('function'); }); it('should export setAnonymousId function', () => { expect(typeof exports.setAnonymousId).toBe('function'); }); it('should export clearAnonymousId function', () => { expect(typeof exports.clearAnonymousId).toBe('function'); }); it('should export getAnonymousId function', () => { expect(typeof exports.getAnonymousId).toBe('function'); }); it('should export startTransaction function', () => { expect(typeof exports.startTransaction).toBe('function'); }); it('should export getCurrentTransaction function', () => { expect(typeof exports.getCurrentTransaction).toBe('function'); }); it('should export getCurrentSpan function', () => { expect(typeof exports.getCurrentSpan).toBe('function'); }); it('should export setSpan function', () => { expect(typeof exports.setSpan).toBe('function'); }); it('should export startSpan function', () => { expect(typeof exports.startSpan).toBe('function'); }); it('should export setTag function', () => { expect(typeof exports.setTag).toBe('function'); }); it('should export setTags function', () => { expect(typeof exports.setTags).toBe('function'); }); it('should export setExtra function', () => { expect(typeof exports.setExtra).toBe('function'); }); it('should export addBreadcrumb function', () => { expect(typeof exports.addBreadcrumb).toBe('function'); }); it('should export flush function', () => { expect(typeof exports.flush).toBe('function'); }); it('should export disable function', () => { expect(typeof exports.disable).toBe('function'); }); it('should export enable function', () => { expect(typeof exports.enable).toBe('function'); }); it('should export Client class', () => { expect(typeof exports.Client).toBe('function'); }); it('should export Span class', () => { expect(typeof exports.Span).toBe('function'); }); it('should export Transaction class', () => { expect(typeof exports.Transaction).toBe('function'); }); it('should export httpStatusToSpanStatus function', () => { expect(typeof exports.httpStatusToSpanStatus).toBe('function'); }); it('should export dbStatusToSpanStatus function', () => { expect(typeof exports.dbStatusToSpanStatus).toBe('function'); }); it('should export statusToSpanStatus function', () => { expect(typeof exports.statusToSpanStatus).toBe('function'); }); it('should export serializeBaggage function', () => { expect(typeof exports.serializeBaggage).toBe('function'); }); it('should export parseBaggage function', () => { expect(typeof exports.parseBaggage).toBe('function'); }); it('should export createBaggageFromTransaction function', () => { expect(typeof exports.createBaggageFromTransaction).toBe('function'); }); }); describe('plugin exports', () => { it('should export ErrorPlugin class', () => { expect(typeof exports.ErrorPlugin).toBe('function'); }); it('should export PerformancePlugin class', () => { expect(typeof exports.PerformancePlugin).toBe('function'); }); it('should export NetworkPlugin class', () => { expect(typeof exports.NetworkPlugin).toBe('function'); }); it('should export BehaviorPlugin class', () => { expect(typeof exports.BehaviorPlugin).toBe('function'); }); it('should export OfflinePlugin class', () => { expect(typeof exports.OfflinePlugin).toBe('function'); }); it('should export SamplingPlugin class', () => { expect(typeof exports.SamplingPlugin).toBe('function'); }); it('should export RouterPlugin class', () => { expect(typeof exports.RouterPlugin).toBe('function'); }); it('should export InteractionPlugin class', () => { expect(typeof exports.InteractionPlugin).toBe('function'); }); }); describe('default export', () => { it('should export default object with core functions', () => { const d = exports.default; expect(d).toBeDefined(); expect(typeof d.init).toBe('function'); expect(typeof d.getClient).toBe('function'); expect(typeof d.captureException).toBe('function'); expect(typeof d.captureMessage).toBe('function'); expect(typeof d.captureEvent).toBe('function'); expect(typeof d.setUser).toBe('function'); expect(typeof d.setAnonymousId).toBe('function'); expect(typeof d.clearAnonymousId).toBe('function'); expect(typeof d.getAnonymousId).toBe('function'); expect(typeof d.startTransaction).toBe('function'); expect(typeof d.getCurrentTransaction).toBe('function'); expect(typeof d.getCurrentSpan).toBe('function'); expect(typeof d.setSpan).toBe('function'); expect(typeof d.startSpan).toBe('function'); expect(typeof d.setTag).toBe('function'); expect(typeof d.setTags).toBe('function'); expect(typeof d.setExtra).toBe('function'); expect(typeof d.addBreadcrumb).toBe('function'); expect(typeof d.flush).toBe('function'); expect(typeof d.disable).toBe('function'); expect(typeof d.enable).toBe('function'); }); it('should export default object with Span and Transaction classes', () => { const d = exports.default; expect(typeof d.Span).toBe('function'); expect(typeof d.Transaction).toBe('function'); }); it('should export default object with utility functions', () => { const d = exports.default; expect(typeof d.httpStatusToSpanStatus).toBe('function'); }); }); });