UNPKG

@sentry/wizard

Version:

Sentry wizard helping you to configure your project

72 lines (68 loc) 2.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const vitest_1 = require("vitest"); const sdk_setup_1 = require("../../src/remix/sdk-setup"); (0, vitest_1.describe)('generateServerInstrumentationFile', () => { (0, vitest_1.it)('should generate server instrumentation file', () => { const result = (0, sdk_setup_1.generateServerInstrumentationFile)('https://sentry.io/123', { performance: true, replay: true, logs: true, }); (0, vitest_1.expect)(result.instrumentationFileMod.generate().code) .toMatchInlineSnapshot(` "import * as Sentry from "@sentry/remix"; Sentry.init({ dsn: "https://sentry.io/123", tracesSampleRate: 1, enableLogs: true })" `); }); (0, vitest_1.it)('should generate server instrumentation file when performance is disabled', () => { const result = (0, sdk_setup_1.generateServerInstrumentationFile)('https://sentry.io/123', { performance: false, replay: true, logs: false, }); (0, vitest_1.expect)(result.instrumentationFileMod.generate().code) .toMatchInlineSnapshot(` "import * as Sentry from "@sentry/remix"; Sentry.init({ dsn: "https://sentry.io/123" })" `); }); (0, vitest_1.it)('should generate server instrumentation file with only logs enabled', () => { const result = (0, sdk_setup_1.generateServerInstrumentationFile)('https://sentry.io/123', { performance: false, replay: false, logs: true, }); (0, vitest_1.expect)(result.instrumentationFileMod.generate().code) .toMatchInlineSnapshot(` "import * as Sentry from "@sentry/remix"; Sentry.init({ dsn: "https://sentry.io/123", enableLogs: true })" `); }); (0, vitest_1.it)('should generate server instrumentation file with performance and logs enabled', () => { const result = (0, sdk_setup_1.generateServerInstrumentationFile)('https://sentry.io/123', { performance: true, replay: false, logs: true, }); (0, vitest_1.expect)(result.instrumentationFileMod.generate().code) .toMatchInlineSnapshot(` "import * as Sentry from "@sentry/remix"; Sentry.init({ dsn: "https://sentry.io/123", tracesSampleRate: 1, enableLogs: true })" `); }); }); //# sourceMappingURL=server-instrumentation.test.js.map