@sentry/wizard 6.10.0 → 6.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/ci-ensure-runtime-loaded.sh +82 -0
- package/dist/e2e-tests/tests/angular-17.test.js +72 -82
- package/dist/e2e-tests/tests/angular-17.test.js.map +1 -1
- package/dist/e2e-tests/tests/angular-19.test.js +71 -80
- package/dist/e2e-tests/tests/angular-19.test.js.map +1 -1
- package/dist/e2e-tests/tests/cloudflare-worker.test.d.ts +1 -0
- package/dist/e2e-tests/tests/cloudflare-worker.test.js +64 -0
- package/dist/e2e-tests/tests/cloudflare-worker.test.js.map +1 -0
- package/dist/e2e-tests/tests/cloudflare-wrangler-sourcemaps.test.js +2 -5
- package/dist/e2e-tests/tests/cloudflare-wrangler-sourcemaps.test.js.map +1 -1
- package/dist/e2e-tests/tests/expo.test.js +36 -61
- package/dist/e2e-tests/tests/expo.test.js.map +1 -1
- package/dist/e2e-tests/tests/flutter.test.js +63 -70
- package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
- package/dist/e2e-tests/tests/help-message.test.js +2 -2
- package/dist/e2e-tests/tests/help-message.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs-14.test.js +48 -76
- package/dist/e2e-tests/tests/nextjs-14.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs-15.test.js +89 -99
- package/dist/e2e-tests/tests/nextjs-15.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs-16.test.js +48 -45
- package/dist/e2e-tests/tests/nextjs-16.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-3.test.js +45 -58
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js +59 -73
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
- package/dist/e2e-tests/tests/pnpm-workspace.test.js +4 -7
- package/dist/e2e-tests/tests/pnpm-workspace.test.js.map +1 -1
- package/dist/e2e-tests/tests/react-native.test.js +44 -80
- package/dist/e2e-tests/tests/react-native.test.js.map +1 -1
- package/dist/e2e-tests/tests/react-router.test.js +163 -145
- package/dist/e2e-tests/tests/react-router.test.js.map +1 -1
- package/dist/e2e-tests/tests/remix.test.js +162 -132
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit-hooks.test.js +48 -36
- package/dist/e2e-tests/tests/sveltekit-hooks.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit-tracing.test.js +3 -6
- package/dist/e2e-tests/tests/sveltekit-tracing.test.js.map +1 -1
- package/dist/e2e-tests/utils/index.d.ts +15 -43
- package/dist/e2e-tests/utils/index.js +95 -185
- package/dist/e2e-tests/utils/index.js.map +1 -1
- package/dist/get-e2e-test-matrix.mjs +11 -0
- package/dist/lib/Constants.d.ts +1 -0
- package/dist/lib/Constants.js +5 -0
- package/dist/lib/Constants.js.map +1 -1
- package/dist/src/android/android-wizard.js +2 -4
- package/dist/src/android/android-wizard.js.map +1 -1
- package/dist/src/angular/angular-wizard.js +4 -6
- package/dist/src/angular/angular-wizard.js.map +1 -1
- package/dist/src/angular/sdk-setup.js +1 -1
- package/dist/src/angular/sdk-setup.js.map +1 -1
- package/dist/src/apple/apple-wizard.js +2 -4
- package/dist/src/apple/apple-wizard.js.map +1 -1
- package/dist/src/cloudflare/cloudflare-wizard.d.ts +3 -0
- package/dist/src/cloudflare/cloudflare-wizard.js +99 -0
- package/dist/src/cloudflare/cloudflare-wizard.js.map +1 -0
- package/dist/src/cloudflare/sdk-setup.d.ts +7 -0
- package/dist/src/cloudflare/sdk-setup.js +47 -0
- package/dist/src/cloudflare/sdk-setup.js.map +1 -0
- package/dist/src/cloudflare/templates.d.ts +4 -0
- package/dist/src/cloudflare/templates.js +44 -0
- package/dist/src/cloudflare/templates.js.map +1 -0
- package/dist/src/cloudflare/wrangler/create-wrangler-config.d.ts +4 -0
- package/dist/src/cloudflare/wrangler/create-wrangler-config.js +27 -0
- package/dist/src/cloudflare/wrangler/create-wrangler-config.js.map +1 -0
- package/dist/src/cloudflare/wrangler/ensure-wrangler-config.d.ts +4 -0
- package/dist/src/cloudflare/wrangler/ensure-wrangler-config.js +25 -0
- package/dist/src/cloudflare/wrangler/ensure-wrangler-config.js.map +1 -0
- package/dist/src/cloudflare/wrangler/find-wrangler-config.d.ts +4 -0
- package/dist/src/cloudflare/wrangler/find-wrangler-config.js +23 -0
- package/dist/src/cloudflare/wrangler/find-wrangler-config.js.map +1 -0
- package/dist/src/cloudflare/wrangler/get-entry-point-from-wrangler-config.d.ts +6 -0
- package/dist/src/cloudflare/wrangler/get-entry-point-from-wrangler-config.js +52 -0
- package/dist/src/cloudflare/wrangler/get-entry-point-from-wrangler-config.js.map +1 -0
- package/dist/src/cloudflare/wrangler/update-wrangler-config.d.ts +17 -0
- package/dist/src/cloudflare/wrangler/update-wrangler-config.js +173 -0
- package/dist/src/cloudflare/wrangler/update-wrangler-config.js.map +1 -0
- package/dist/src/cloudflare/wrap-worker.d.ts +32 -0
- package/dist/src/cloudflare/wrap-worker.js +109 -0
- package/dist/src/cloudflare/wrap-worker.js.map +1 -0
- package/dist/src/flutter/flutter-wizard.js +3 -6
- package/dist/src/flutter/flutter-wizard.js.map +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +0 -2
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nuxt/nuxt-wizard.js +3 -5
- package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
- package/dist/src/react-native/react-native-wizard.js +2 -4
- package/dist/src/react-native/react-native-wizard.js.map +1 -1
- package/dist/src/react-router/react-router-wizard.js +3 -5
- package/dist/src/react-router/react-router-wizard.js.map +1 -1
- package/dist/src/react-router/sdk-setup.d.ts +1 -1
- package/dist/src/react-router/sdk-setup.js +3 -4
- package/dist/src/react-router/sdk-setup.js.map +1 -1
- package/dist/src/remix/remix-wizard.js +2 -4
- package/dist/src/remix/remix-wizard.js.map +1 -1
- package/dist/src/run.d.ts +1 -1
- package/dist/src/run.js +5 -0
- package/dist/src/run.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +2 -4
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/src/utils/abort-if-sportlight-not-supported.d.ts +5 -0
- package/dist/src/utils/abort-if-sportlight-not-supported.js +40 -0
- package/dist/src/utils/abort-if-sportlight-not-supported.js.map +1 -0
- package/dist/src/utils/ast-utils.d.ts +1 -1
- package/dist/src/utils/ast-utils.js.map +1 -1
- package/dist/src/utils/clack/index.d.ts +2 -2
- package/dist/src/utils/clack/index.js.map +1 -1
- package/dist/src/utils/clack/mcp-config.js +117 -59
- package/dist/src/utils/clack/mcp-config.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/test/angular/angular-wizard.test.js +2 -4
- package/dist/test/angular/angular-wizard.test.js.map +1 -1
- package/dist/test/cloudflare/create-wrangler-config.test.d.ts +1 -0
- package/dist/test/cloudflare/create-wrangler-config.test.js +48 -0
- package/dist/test/cloudflare/create-wrangler-config.test.js.map +1 -0
- package/dist/test/cloudflare/ensure-wrangler-config.test.d.ts +1 -0
- package/dist/test/cloudflare/ensure-wrangler-config.test.js +61 -0
- package/dist/test/cloudflare/ensure-wrangler-config.test.js.map +1 -0
- package/dist/test/cloudflare/find-wrangler-config.test.d.ts +1 -0
- package/dist/test/cloudflare/find-wrangler-config.test.js +77 -0
- package/dist/test/cloudflare/find-wrangler-config.test.js.map +1 -0
- package/dist/test/cloudflare/get-entry-point-from-wrangler-config.test.d.ts +1 -0
- package/dist/test/cloudflare/get-entry-point-from-wrangler-config.test.js +81 -0
- package/dist/test/cloudflare/get-entry-point-from-wrangler-config.test.js.map +1 -0
- package/dist/test/cloudflare/sdk-setup.test.d.ts +1 -0
- package/dist/test/cloudflare/sdk-setup.test.js +152 -0
- package/dist/test/cloudflare/sdk-setup.test.js.map +1 -0
- package/dist/test/cloudflare/templates.test.d.ts +1 -0
- package/dist/test/cloudflare/templates.test.js +68 -0
- package/dist/test/cloudflare/templates.test.js.map +1 -0
- package/dist/test/cloudflare/update-wrangler-config.test.d.ts +1 -0
- package/dist/test/cloudflare/update-wrangler-config.test.js +216 -0
- package/dist/test/cloudflare/update-wrangler-config.test.js.map +1 -0
- package/dist/test/cloudflare/wrap-worker.test.d.ts +1 -0
- package/dist/test/cloudflare/wrap-worker.test.js +143 -0
- package/dist/test/cloudflare/wrap-worker.test.js.map +1 -0
- package/dist/test/react-router/sdk-setup.test.js +2 -2
- package/dist/test/react-router/sdk-setup.test.js.map +1 -1
- package/dist/test/utils/clack/mcp-config.test.js +176 -51
- package/dist/test/utils/clack/mcp-config.test.js.map +1 -1
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextjs-15.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/nextjs-15.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAClC,4CAA8B;AAC9B,mDAAkD;AAClD,oCAMkB;AAClB,oCAA+C;AAC/C,oCAOkB;AAClB,mCAAqE;AAErE,IAAA,iBAAQ,EAAC,WAAW,EAAE,GAAG,EAAE;IACzB,MAAM,WAAW,GAAG,uBAAW,CAAC,MAAM,CAAC;IACvC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAC7B,SAAS,EACT,yCAAyC,CAC1C,CAAC;IAEF,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;QACnB,MAAM,cAAc,GAAG,IAAA,2BAAmB,EAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QACpE,MAAM,sBAAsB,GAAG,MAAM,cAAc,CAAC,aAAa,CAC/D,qCAAqC,CACtC,CAAC;QAEF,MAAM,0BAA0B,GAC9B,sBAAsB;YACtB,CAAC,MAAM,cAAc,CAAC,yBAAyB;YAC7C,0CAA0C;YAC1C,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,GAAG,EAAE;QACpE,IAAA,yBAAiB,EAAC,GAAG,UAAU,0BAA0B,EAAE;YACzD,SAAS;YACT,iBAAiB;SAClB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,wDAAwD,EAAE,GAAG,EAAE;QAClE,IAAA,yBAAiB,EAAC,GAAG,UAAU,wBAAwB,EAAE;YACvD,SAAS;YACT,iBAAiB;SAClB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,mEAAmE,EAAE,GAAG,EAAE;QAC7E,IAAA,uBAAe,EAAC,GAAG,UAAU,gCAAgC,CAAC,CAAC;QAC/D,IAAA,yBAAiB,EAAC,GAAG,UAAU,gCAAgC,EAAE;YAC/D,SAAS;YACT,iBAAiB;SAClB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,IAAA,qBAAa,EAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,IAAA,4BAAoB,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import * as path from 'node:path';\nimport * as fs from 'node:fs';\nimport { Integration } from '../../lib/Constants';\nimport {\n KEYS,\n checkEnvBuildPlugin,\n checkFileDoesNotExist,\n cleanupGit,\n revertLocalChanges,\n} from '../utils';\nimport { startWizardInstance } from '../utils';\nimport {\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n} from '../utils';\nimport { describe, beforeAll, afterAll, test, expect } from 'vitest';\n\ndescribe('NextJS-15', () => {\n const integration = Integration.nextjs;\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/nextjs-15-test-app',\n );\n\n beforeAll(async () => {\n const wizardInstance = startWizardInstance(integration, projectDir);\n const packageManagerPrompted = await wizardInstance.waitForOutput(\n 'Please select your package manager.',\n );\n\n const routeThroughNextJsPrompted =\n packageManagerPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Selecting `yarn` as the package manager\n [KEYS.DOWN, KEYS.ENTER],\n 'Do you want to route Sentry requests in the browser through your Next.js server',\n {\n timeout: 240_000,\n },\n ));\n\n const tracingOptionPrompted =\n routeThroughNextJsPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Tracing\", sometimes doesn't work as `Tracing` can be printed in bold.\n 'to track the performance of your application?',\n ));\n\n const replayOptionPrompted =\n tracingOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Sentry Session Replay\", sometimes doesn't work as `Sentry Session Replay` can be printed in bold.\n 'to get a video-like reproduction of errors during a user session?',\n ));\n\n const logOptionPrompted =\n replayOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Logs\", sometimes doesn't work as `Logs` can be printed in bold.\n 'to send your application logs to Sentry?',\n ));\n\n const examplePagePrompted =\n logOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Do you want to create an example page',\n {\n optional: true,\n },\n ));\n\n const ciCdPrompted =\n examplePagePrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Are you using a CI/CD tool',\n ));\n\n // Selecting `No` for CI/CD tool\n const mcpPrompted =\n ciCdPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.DOWN, KEYS.ENTER],\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n { optional: true },\n ));\n\n // Accept MCP config (default is now Yes)\n const editorPrompted =\n mcpPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Which editor do you want to configure?',\n ));\n\n // Select Cursor as the editor (first option)\n editorPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Successfully installed the Sentry Next.js SDK!',\n ));\n\n wizardInstance.kill();\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, integration);\n });\n\n test('.env-sentry-build-plugin is created and contains the auth token', () => {\n checkEnvBuildPlugin(projectDir);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/src/app/sentry-example-page/page.tsx`);\n checkFileExists(`${projectDir}/src/app/api/sentry-example-api/route.ts`);\n });\n\n test('config files created', () => {\n checkFileExists(`${projectDir}/sentry.server.config.ts`);\n checkFileExists(`${projectDir}/sentry.edge.config.ts`);\n });\n\n test('global error file exists', () => {\n checkFileExists(`${projectDir}/src/app/global-error.tsx`);\n });\n\n test('instrumentation files exists', () => {\n checkFileExists(`${projectDir}/src/instrumentation.ts`);\n checkFileExists(`${projectDir}/src/instrumentation-client.ts`);\n });\n\n test('instrumentation file contains Sentry initialization', () => {\n checkFileContents(`${projectDir}/src/instrumentation.ts`, [\n 'import * as Sentry from \"@sentry/nextjs\";',\n `export async function register() {\n if (process.env.NEXT_RUNTIME === \"nodejs\") {\n await import(\"../sentry.server.config\");\n }\n\n if (process.env.NEXT_RUNTIME === \"edge\") {\n await import(\"../sentry.edge.config\");\n }\n}\n\nexport const onRequestError = Sentry.captureRequestError;`,\n ]);\n });\n\n test('next.config file contains Sentry wrapper', () => {\n checkFileContents(`${projectDir}/next.config.ts`, [\n 'import { withSentryConfig } from \"@sentry/nextjs\"',\n 'export default withSentryConfig(nextConfig, {',\n ]);\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(projectDir, 'Ready in');\n });\n\n test('builds correctly', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(projectDir, 'Ready in');\n });\n\n test('MCP configuration file is created for Cursor', () => {\n checkFileExists(`${projectDir}/.cursor/mcp.json`);\n checkFileContents(`${projectDir}/.cursor/mcp.json`, [\n '\"mcpServers\"',\n '\"Sentry\"',\n '\"url\": \"https://mcp.sentry.dev/mcp/sentry-javascript-sdks/sentry-wizard-e2e-tests\"',\n ]);\n });\n});\n\ndescribe('NextJS-15 Spotlight', () => {\n const integration = Integration.nextjs;\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/nextjs-15-test-app',\n );\n\n beforeAll(async () => {\n // Clean up any previous test artifacts including ignored files like .env.sentry-build-plugin\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n\n // Explicitly remove .env.sentry-build-plugin if it exists\n const envBuildPluginPath = path.join(\n projectDir,\n '.env.sentry-build-plugin',\n );\n if (fs.existsSync(envBuildPluginPath)) {\n fs.unlinkSync(envBuildPluginPath);\n }\n\n const wizardInstance = startWizardInstance(\n integration,\n projectDir,\n false,\n true,\n );\n\n const spotlightModePrompted = await wizardInstance.waitForOutput(\n 'Spotlight mode enabled!',\n );\n\n const packageManagerPrompted =\n spotlightModePrompted &&\n (await wizardInstance.waitForOutput(\n 'Please select your package manager.',\n ));\n\n const routeThroughNextJsPrompted =\n packageManagerPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Selecting `yarn` as the package manager\n [KEYS.DOWN, KEYS.ENTER],\n 'Do you want to route Sentry requests in the browser through your Next.js server',\n {\n timeout: 240_000,\n },\n ));\n\n const tracingOptionPrompted =\n routeThroughNextJsPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'to track the performance of your application?',\n ));\n\n const replayOptionPrompted =\n tracingOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'to get a video-like reproduction of errors during a user session?',\n ));\n\n const logOptionPrompted =\n replayOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'to send your application logs to Sentry?',\n ));\n\n // Skip example page creation\n logOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.DOWN, KEYS.ENTER],\n 'Successfully installed the Sentry Next.js SDK!',\n {\n optional: true,\n },\n ));\n\n wizardInstance.kill();\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, integration);\n });\n\n test('.env-sentry-build-plugin should NOT exist in spotlight mode', () => {\n const envFilePath = `${projectDir}/.env.sentry-build-plugin`;\n checkFileDoesNotExist(envFilePath);\n // Explicit assertion to satisfy linter\n expect(fs.existsSync(envFilePath)).toBe(false);\n });\n\n test('config files created', () => {\n checkFileExists(`${projectDir}/sentry.server.config.ts`);\n checkFileExists(`${projectDir}/sentry.edge.config.ts`);\n });\n\n test('server config file contains empty DSN and spotlight flag', () => {\n checkFileContents(`${projectDir}/sentry.server.config.ts`, [\n 'dsn: \"\"',\n 'spotlight: true',\n ]);\n });\n\n test('edge config file contains empty DSN and spotlight flag', () => {\n checkFileContents(`${projectDir}/sentry.edge.config.ts`, [\n 'dsn: \"\"',\n 'spotlight: true',\n ]);\n });\n\n test('instrumentation client file contains empty DSN and spotlight flag', () => {\n checkFileExists(`${projectDir}/src/instrumentation-client.ts`);\n checkFileContents(`${projectDir}/src/instrumentation-client.ts`, [\n 'dsn: \"\"',\n 'spotlight: true',\n ]);\n });\n\n test('builds correctly', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(projectDir, 'Ready in');\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"nextjs-15.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/nextjs-15.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,mDAAkD;AAClD,oCAKkB;AAClB,oCAQkB;A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AU,gCAAgC,CAAC,CAAC;QAC/D,IAAA,yBAAiB,EAAC,GAAG,UAAU,gCAAgC,EAAE;YAC/D,SAAS;YACT,iBAAiB;SAClB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,IAAA,qBAAa,EAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,IAAA,4BAAoB,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport { Integration } from '../../lib/Constants';\nimport {\n TEST_ARGS,\n checkEnvBuildPlugin,\n checkFileDoesNotExist,\n createIsolatedTestEnv,\n} from '../utils';\nimport {\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n getWizardCommand,\n} from '../utils';\nimport { describe, beforeAll, afterAll, test, expect } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('NextJS-15', () => {\n const integration = Integration.nextjs;\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv('nextjs-15-test-app');\n\n beforeAll(async () => {\n wizardExitCode = await withEnv({\n cwd: projectDir,\n })\n .defineInteraction()\n .whenAsked('Please select your package manager.')\n .respondWith(KEYS.DOWN, KEYS.ENTER) // Select yarn\n .whenAsked(\n 'Do you want to route Sentry requests in the browser through your Next.js server',\n {\n timeout: 240_000, // package installation can take a while in CI\n },\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('to track the performance of your application?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'to get a video-like reproduction of errors during a user session?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('to send your application logs to Sentry?')\n .respondWith(KEYS.ENTER)\n .whenAsked('Do you want to create an example page')\n .respondWith(KEYS.ENTER)\n .whenAsked('Are you using a CI/CD tool')\n .respondWith(KEYS.DOWN, KEYS.ENTER) // Select No\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.ENTER) // Accept MCP config\n .whenAsked('Which editor(s) do you want to configure?')\n .respondWith(KEYS.SPACE, KEYS.ENTER) // Select Cursor\n .expectOutput('Successfully installed the Sentry Next.js SDK!')\n .run(getWizardCommand(integration));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n test('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, '@sentry/nextjs');\n });\n\n test('.env-sentry-build-plugin is created and contains the auth token', () => {\n checkEnvBuildPlugin(projectDir);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/src/app/sentry-example-page/page.tsx`);\n checkFileExists(`${projectDir}/src/app/api/sentry-example-api/route.ts`);\n });\n\n test('config files created', () => {\n checkFileExists(`${projectDir}/sentry.server.config.ts`);\n checkFileExists(`${projectDir}/sentry.edge.config.ts`);\n });\n\n test('global error file exists', () => {\n checkFileExists(`${projectDir}/src/app/global-error.tsx`);\n });\n\n test('instrumentation files exists', () => {\n checkFileExists(`${projectDir}/src/instrumentation.ts`);\n checkFileExists(`${projectDir}/src/instrumentation-client.ts`);\n });\n\n test('instrumentation file contains Sentry initialization', () => {\n checkFileContents(`${projectDir}/src/instrumentation.ts`, [\n 'import * as Sentry from \"@sentry/nextjs\";',\n `export async function register() {\n if (process.env.NEXT_RUNTIME === \"nodejs\") {\n await import(\"../sentry.server.config\");\n }\n\n if (process.env.NEXT_RUNTIME === \"edge\") {\n await import(\"../sentry.edge.config\");\n }\n}\n\nexport const onRequestError = Sentry.captureRequestError;`,\n ]);\n });\n\n test('next.config file contains Sentry wrapper', () => {\n checkFileContents(`${projectDir}/next.config.ts`, [\n 'import { withSentryConfig } from \"@sentry/nextjs\"',\n 'export default withSentryConfig(nextConfig, {',\n ]);\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(projectDir, 'Ready in');\n });\n\n test('builds correctly', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(projectDir, 'Ready in');\n });\n\n test('MCP configuration file is created for Cursor', () => {\n checkFileExists(`${projectDir}/.cursor/mcp.json`);\n checkFileContents(`${projectDir}/.cursor/mcp.json`, [\n '\"mcpServers\"',\n '\"Sentry\"',\n `\"url\": \"https://mcp.sentry.dev/mcp/${TEST_ARGS.ORG_SLUG}/${TEST_ARGS.PROJECT_SLUG}\"`,\n ]);\n });\n});\n\ndescribe('NextJS-15 Spotlight', () => {\n const integration = Integration.nextjs;\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv('nextjs-15-test-app');\n\n beforeAll(async () => {\n wizardExitCode = await withEnv({\n cwd: projectDir,\n })\n .defineInteraction()\n .expectOutput('Spotlight mode enabled!')\n .whenAsked('Please select your package manager.')\n .respondWith(KEYS.DOWN, KEYS.ENTER) // Select yarn\n .expectOutput('Installing @sentry/nextjs')\n .whenAsked(\n 'Do you want to route Sentry requests in the browser through your Next.js server',\n {\n timeout: 240_000, // package installation can take a while in CI\n },\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('to track the performance of your application?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'to get a video-like reproduction of errors during a user session?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('to send your application logs to Sentry?')\n .respondWith(KEYS.ENTER)\n .whenAsked('Do you want to create an example page')\n .respondWith(KEYS.DOWN, KEYS.ENTER) // Skip example page\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER) // Decline MCP config\n .expectOutput('Successfully installed the Sentry Next.js SDK!')\n .run(`${getWizardCommand(integration)} --spotlight`);\n });\n\n afterAll(() => {\n cleanup();\n });\n\n test('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, '@sentry/nextjs');\n });\n\n test('.env-sentry-build-plugin should NOT exist in spotlight mode', () => {\n const envFilePath = `${projectDir}/.env.sentry-build-plugin`;\n checkFileDoesNotExist(envFilePath);\n // Explicit assertion to satisfy linter\n expect(fs.existsSync(envFilePath)).toBe(false);\n });\n\n test('config files created', () => {\n checkFileExists(`${projectDir}/sentry.server.config.ts`);\n checkFileExists(`${projectDir}/sentry.edge.config.ts`);\n });\n\n test('server config file contains empty DSN and spotlight flag', () => {\n checkFileContents(`${projectDir}/sentry.server.config.ts`, [\n 'dsn: \"\"',\n 'spotlight: true',\n ]);\n });\n\n test('edge config file contains empty DSN and spotlight flag', () => {\n checkFileContents(`${projectDir}/sentry.edge.config.ts`, [\n 'dsn: \"\"',\n 'spotlight: true',\n ]);\n });\n\n test('instrumentation client file contains empty DSN and spotlight flag', () => {\n checkFileExists(`${projectDir}/src/instrumentation-client.ts`);\n checkFileContents(`${projectDir}/src/instrumentation-client.ts`, [\n 'dsn: \"\"',\n 'spotlight: true',\n ]);\n });\n\n test('builds correctly', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(projectDir, 'Ready in');\n });\n});\n"]}
|
|
@@ -24,67 +24,70 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const fs = __importStar(require("node:fs"));
|
|
27
|
-
const path = __importStar(require("node:path"));
|
|
28
27
|
const Constants_1 = require("../../lib/Constants");
|
|
29
28
|
const utils_1 = require("../utils");
|
|
30
|
-
const utils_2 = require("../utils");
|
|
31
|
-
const utils_3 = require("../utils");
|
|
32
29
|
const vitest_1 = require("vitest");
|
|
30
|
+
//@ts-expect-error - clifty is ESM only
|
|
31
|
+
const clifty_1 = require("clifty");
|
|
33
32
|
(0, vitest_1.describe)('NextJS-16 with Prettier, Biome, and ESLint', () => {
|
|
34
33
|
const integration = Constants_1.Integration.nextjs;
|
|
35
|
-
|
|
34
|
+
let wizardExitCode;
|
|
35
|
+
const { projectDir, cleanup } = (0, utils_1.createIsolatedTestEnv)('nextjs-16-test-app');
|
|
36
36
|
(0, vitest_1.beforeAll)(async () => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
wizardExitCode = await (0, clifty_1.withEnv)({
|
|
38
|
+
cwd: projectDir,
|
|
39
|
+
})
|
|
40
|
+
.defineInteraction()
|
|
41
|
+
.whenAsked('Please select your package manager', {
|
|
40
42
|
timeout: 300000,
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
wizardInstance.kill();
|
|
43
|
+
})
|
|
44
|
+
.respondWith(clifty_1.KEYS.ENTER) // Select npm (first option)
|
|
45
|
+
.expectOutput('Installing @sentry/nextjs')
|
|
46
|
+
.whenAsked('Do you want to route Sentry requests in the browser through your Next.js server', {
|
|
47
|
+
timeout: 300000, // package installation can take a while in CI
|
|
48
|
+
})
|
|
49
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
50
|
+
.whenAsked('to track the performance of your application?')
|
|
51
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
52
|
+
.whenAsked('to get a video-like reproduction of errors during a user session?')
|
|
53
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
54
|
+
.whenAsked('to send your application logs to Sentry?')
|
|
55
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
56
|
+
.whenAsked('Do you want to create an example page')
|
|
57
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER) // Skip example page
|
|
58
|
+
.whenAsked('Are you using a CI/CD tool')
|
|
59
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER) // Select No
|
|
60
|
+
.whenAsked('Optionally add a project-scoped MCP server configuration for the Sentry MCP?')
|
|
61
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER) // Skip MCP config
|
|
62
|
+
.whenAsked('Looks like you have Prettier and Biome in your project')
|
|
63
|
+
.respondWith(clifty_1.KEYS.ENTER) // Accept formatter run
|
|
64
|
+
.expectOutput('Running formatters on your files...')
|
|
65
|
+
.expectOutput('Formatters have processed your files', { timeout: 60000 })
|
|
66
|
+
.expectOutput('Successfully installed the Sentry Next.js SDK!')
|
|
67
|
+
.run((0, utils_1.getWizardCommand)(integration));
|
|
67
68
|
});
|
|
68
69
|
(0, vitest_1.afterAll)(() => {
|
|
69
|
-
(
|
|
70
|
-
|
|
70
|
+
cleanup();
|
|
71
|
+
});
|
|
72
|
+
(0, vitest_1.test)('exits with exit code 0', () => {
|
|
73
|
+
(0, vitest_1.expect)(wizardExitCode).toBe(0);
|
|
71
74
|
});
|
|
72
75
|
(0, vitest_1.test)('package.json is updated correctly', () => {
|
|
73
|
-
(0,
|
|
76
|
+
(0, utils_1.checkPackageJson)(projectDir, '@sentry/nextjs');
|
|
74
77
|
});
|
|
75
78
|
(0, vitest_1.test)('config files created', () => {
|
|
76
|
-
(0,
|
|
77
|
-
(0,
|
|
79
|
+
(0, utils_1.checkFileExists)(`${projectDir}/sentry.server.config.ts`);
|
|
80
|
+
(0, utils_1.checkFileExists)(`${projectDir}/sentry.edge.config.ts`);
|
|
78
81
|
});
|
|
79
82
|
(0, vitest_1.test)('global error file exists', () => {
|
|
80
|
-
(0,
|
|
83
|
+
(0, utils_1.checkFileExists)(`${projectDir}/app/global-error.tsx`);
|
|
81
84
|
});
|
|
82
85
|
(0, vitest_1.test)('instrumentation files exist', () => {
|
|
83
|
-
(0,
|
|
84
|
-
(0,
|
|
86
|
+
(0, utils_1.checkFileExists)(`${projectDir}/instrumentation.ts`);
|
|
87
|
+
(0, utils_1.checkFileExists)(`${projectDir}/instrumentation-client.ts`);
|
|
85
88
|
});
|
|
86
89
|
(0, vitest_1.test)('instrumentation file contains Sentry initialization', () => {
|
|
87
|
-
(0,
|
|
90
|
+
(0, utils_1.checkFileContents)(`${projectDir}/instrumentation.ts`, [
|
|
88
91
|
'import * as Sentry from "@sentry/nextjs";',
|
|
89
92
|
`export async function register() {
|
|
90
93
|
if (process.env.NEXT_RUNTIME === "nodejs") {
|
|
@@ -100,7 +103,7 @@ export const onRequestError = Sentry.captureRequestError;`,
|
|
|
100
103
|
]);
|
|
101
104
|
});
|
|
102
105
|
(0, vitest_1.test)('next.config file contains Sentry wrapper', () => {
|
|
103
|
-
(0,
|
|
106
|
+
(0, utils_1.checkFileContents)(`${projectDir}/next.config.ts`, [
|
|
104
107
|
'import { withSentryConfig } from "@sentry/nextjs"',
|
|
105
108
|
'withSentryConfig(nextConfig, {',
|
|
106
109
|
]);
|
|
@@ -111,10 +114,10 @@ export const onRequestError = Sentry.captureRequestError;`,
|
|
|
111
114
|
(0, vitest_1.expect)(configContent).toMatch(/import\s+{\s+\w+\s+}\s+from/);
|
|
112
115
|
});
|
|
113
116
|
(0, vitest_1.test)('builds correctly', async () => {
|
|
114
|
-
await (0,
|
|
117
|
+
await (0, utils_1.checkIfBuilds)(projectDir);
|
|
115
118
|
});
|
|
116
119
|
(0, vitest_1.test)('lints correctly', async () => {
|
|
117
|
-
await (0,
|
|
120
|
+
await (0, utils_1.checkIfLints)(projectDir);
|
|
118
121
|
});
|
|
119
122
|
});
|
|
120
123
|
//# sourceMappingURL=nextjs-16.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextjs-16.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/nextjs-16.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"nextjs-16.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/nextjs-16.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,mDAAkD;AAClD,oCAQkB;AAClB,mCAAqE;AAErE,uCAAuC;AACvC,mCAAuC;AAEvC,IAAA,iBAAQ,EAAC,4CAA4C,EAAE,GAAG,EAAE;IAC1D,MAAM,WAAW,GAAG,uBAAW,CAAC,MAAM,CAAC;IACvC,IAAI,cAAsB,CAAC;IAE3B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,6BAAqB,EAAC,oBAAoB,CAAC,CAAC;IAE5E,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;QACnB,cAAc,GAAG,MAAM,IAAA,gBAAO,EAAC;YAC7B,GAAG,EAAE,UAAU;SAChB,CAAC;aACC,iBAAiB,EAAE;aACnB,SAAS,CAAC,oCAAoC,EAAE;YAC/C,OAAO,EAAE,MAAO;SACjB,CAAC;aACD,WAAW,CAAC,aAAI,CAAC,KAAK,CAAC,CAAC,4BAA4B;aACpD,YAAY,CAAC,2BAA2B,CAAC;aACzC,SAAS,CACR,iFAAiF,EACjF;YACE,OAAO,EAAE,MAAO,EAAE,8CAA8C;SACjE,CACF;aACA,WAAW,CAAC,aAAI,CAAC,KAAK,CAAC;aACvB,SAAS,CAAC,+CAA+C,CAAC;aAC1D,WAAW,CAAC,aAAI,CAAC,KAAK,CAAC;aACvB,SAAS,CACR,mEAAmE,CACpE;aACA,WAAW,CAAC,aAAI,CAAC,KAAK,CAAC;aACvB,SAAS,CAAC,0CAA0C,CAAC;aACrD,WAAW,CAAC,aAAI,CAAC,K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s';\nimport { Integration } from '../../lib/Constants';\nimport {\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfLints,\n checkPackageJson,\n createIsolatedTestEnv,\n getWizardCommand,\n} from '../utils';\nimport { describe, beforeAll, afterAll, test, expect } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('NextJS-16 with Prettier, Biome, and ESLint', () => {\n const integration = Integration.nextjs;\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv('nextjs-16-test-app');\n\n beforeAll(async () => {\n wizardExitCode = await withEnv({\n cwd: projectDir,\n })\n .defineInteraction()\n .whenAsked('Please select your package manager', {\n timeout: 300_000,\n })\n .respondWith(KEYS.ENTER) // Select npm (first option)\n .expectOutput('Installing @sentry/nextjs')\n .whenAsked(\n 'Do you want to route Sentry requests in the browser through your Next.js server',\n {\n timeout: 300_000, // package installation can take a while in CI\n },\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('to track the performance of your application?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'to get a video-like reproduction of errors during a user session?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('to send your application logs to Sentry?')\n .respondWith(KEYS.ENTER)\n .whenAsked('Do you want to create an example page')\n .respondWith(KEYS.DOWN, KEYS.ENTER) // Skip example page\n .whenAsked('Are you using a CI/CD tool')\n .respondWith(KEYS.DOWN, KEYS.ENTER) // Select No\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER) // Skip MCP config\n .whenAsked('Looks like you have Prettier and Biome in your project')\n .respondWith(KEYS.ENTER) // Accept formatter run\n .expectOutput('Running formatters on your files...')\n .expectOutput('Formatters have processed your files', { timeout: 60_000 })\n .expectOutput('Successfully installed the Sentry Next.js SDK!')\n .run(getWizardCommand(integration));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n test('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, '@sentry/nextjs');\n });\n\n test('config files created', () => {\n checkFileExists(`${projectDir}/sentry.server.config.ts`);\n checkFileExists(`${projectDir}/sentry.edge.config.ts`);\n });\n\n test('global error file exists', () => {\n checkFileExists(`${projectDir}/app/global-error.tsx`);\n });\n\n test('instrumentation files exist', () => {\n checkFileExists(`${projectDir}/instrumentation.ts`);\n checkFileExists(`${projectDir}/instrumentation-client.ts`);\n });\n\n test('instrumentation file contains Sentry initialization', () => {\n checkFileContents(`${projectDir}/instrumentation.ts`, [\n 'import * as Sentry from \"@sentry/nextjs\";',\n `export async function register() {\n if (process.env.NEXT_RUNTIME === \"nodejs\") {\n await import(\"./sentry.server.config\");\n }\n\n if (process.env.NEXT_RUNTIME === \"edge\") {\n await import(\"./sentry.edge.config\");\n }\n}\n\nexport const onRequestError = Sentry.captureRequestError;`,\n ]);\n });\n\n test('next.config file contains Sentry wrapper', () => {\n checkFileContents(`${projectDir}/next.config.ts`, [\n 'import { withSentryConfig } from \"@sentry/nextjs\"',\n 'withSentryConfig(nextConfig, {',\n ]);\n });\n\n test('Generated code has proper import formatting', () => {\n const configContent = fs.readFileSync(\n `${projectDir}/next.config.ts`,\n 'utf-8',\n );\n // Verify proper spacing: import { withSentryConfig } from\n expect(configContent).toMatch(/import\\s+{\\s+\\w+\\s+}\\s+from/);\n });\n\n test('builds correctly', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('lints correctly', async () => {\n await checkIfLints(projectDir);\n });\n});\n"]}
|
|
@@ -27,65 +27,56 @@ const path = __importStar(require("node:path"));
|
|
|
27
27
|
const Constants_1 = require("../../lib/Constants");
|
|
28
28
|
const utils_1 = require("../utils");
|
|
29
29
|
const vitest_1 = require("vitest");
|
|
30
|
+
//@ts-expect-error - clifty is ESM only
|
|
31
|
+
const clifty_1 = require("clifty");
|
|
30
32
|
(0, vitest_1.describe)('Nuxt-3', () => {
|
|
31
|
-
|
|
33
|
+
let wizardExitCode;
|
|
34
|
+
const { projectDir, cleanup } = (0, utils_1.createIsolatedTestEnv)('nuxt-3-test-app');
|
|
32
35
|
(0, vitest_1.beforeAll)(async () => {
|
|
33
|
-
await
|
|
36
|
+
wizardExitCode = await (0, clifty_1.withEnv)({
|
|
37
|
+
cwd: projectDir,
|
|
38
|
+
})
|
|
39
|
+
.defineInteraction()
|
|
40
|
+
.expectOutput('The Sentry Nuxt Wizard will help you set up Sentry for your application')
|
|
41
|
+
.whenAsked('Please select your package manager.')
|
|
42
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER)
|
|
43
|
+
.whenAsked('Do you want to add an override for @vercel/nft')
|
|
44
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
45
|
+
.expectOutput('Installing @sentry/nuxt')
|
|
46
|
+
.expectOutput('Installed @sentry/nuxt', {
|
|
47
|
+
timeout: 240000,
|
|
48
|
+
})
|
|
49
|
+
.expectOutput('Created .env.sentry-build-plugin')
|
|
50
|
+
.whenAsked('Please select your deployment platform')
|
|
51
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.DOWN, clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER)
|
|
52
|
+
.expectOutput('Added Sentry Nuxt Module to nuxt.config.ts')
|
|
53
|
+
.whenAsked('Do you want to enable Tracing')
|
|
54
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
55
|
+
.whenAsked('Do you want to enable Session Replay')
|
|
56
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
57
|
+
.whenAsked('Do you want to enable Logs')
|
|
58
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
59
|
+
.expectOutput('Created new sentry.server.config.ts')
|
|
60
|
+
.expectOutput('Created new sentry.client.config.ts')
|
|
61
|
+
.whenAsked('Do you want to create an example page')
|
|
62
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
63
|
+
.expectOutput('Created pages/index.vue')
|
|
64
|
+
.expectOutput('After building your Nuxt app, you need to --import the Sentry server config file when running your app')
|
|
65
|
+
.whenAsked('Do you want to open the docs?')
|
|
66
|
+
.respondWith(clifty_1.KEYS.RIGHT, clifty_1.KEYS.ENTER) // no
|
|
67
|
+
.whenAsked('Optionally add a project-scoped MCP server configuration for the Sentry MCP?')
|
|
68
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER)
|
|
69
|
+
.expectOutput('Successfully installed the Sentry Nuxt SDK!')
|
|
70
|
+
.run((0, utils_1.getWizardCommand)(Constants_1.Integration.nuxt));
|
|
34
71
|
});
|
|
35
72
|
(0, vitest_1.afterAll)(() => {
|
|
36
|
-
(
|
|
37
|
-
|
|
73
|
+
cleanup();
|
|
74
|
+
});
|
|
75
|
+
(0, vitest_1.test)('exits with exit code 0', () => {
|
|
76
|
+
(0, vitest_1.expect)(wizardExitCode).toBe(0);
|
|
38
77
|
});
|
|
39
|
-
testNuxtProjectSetup(projectDir);
|
|
40
|
-
testNuxtProjectConfigs(projectDir);
|
|
41
|
-
testNuxtProjectBuildsAndRuns(projectDir);
|
|
42
|
-
});
|
|
43
|
-
async function runWizardOnNuxtProject(projectDir) {
|
|
44
|
-
const integration = Constants_1.Integration.nuxt;
|
|
45
|
-
const wizardInstance = (0, utils_1.startWizardInstance)(integration, projectDir);
|
|
46
|
-
const packageManagerPrompted = await wizardInstance.waitForOutput('Please select your package manager.');
|
|
47
|
-
const nftOverridePrompted = packageManagerPrompted &&
|
|
48
|
-
(await wizardInstance.sendStdinAndWaitForOutput(
|
|
49
|
-
// Selecting `yarn` as the package manager
|
|
50
|
-
[utils_1.KEYS.DOWN, utils_1.KEYS.ENTER], 'Do you want to add an override for @vercel/nft version ^0.27.4?', {
|
|
51
|
-
timeout: 240000,
|
|
52
|
-
}));
|
|
53
|
-
const deploymentPlatformPrompted = nftOverridePrompted &&
|
|
54
|
-
(await wizardInstance.sendStdinAndWaitForOutput(utils_1.KEYS.ENTER, 'Please select your deployment platform.', {
|
|
55
|
-
timeout: 240000,
|
|
56
|
-
}));
|
|
57
|
-
const tracingOptionPrompted = deploymentPlatformPrompted &&
|
|
58
|
-
(await wizardInstance.sendStdinAndWaitForOutput(utils_1.KEYS.ENTER,
|
|
59
|
-
// "Do you want to enable Tracing", sometimes doesn't work as `Tracing` can be printed in bold.
|
|
60
|
-
'Do you want to enable', {
|
|
61
|
-
timeout: 240000,
|
|
62
|
-
}));
|
|
63
|
-
const replayOptionPrompted = tracingOptionPrompted &&
|
|
64
|
-
(await wizardInstance.sendStdinAndWaitForOutput(utils_1.KEYS.ENTER,
|
|
65
|
-
// "Do you want to enable Sentry Session Replay", sometimes doesn't work as `Sentry Session Replay` can be printed in bold.
|
|
66
|
-
'to get a video-like reproduction of errors during a user session?'));
|
|
67
|
-
const logOptionPrompted = replayOptionPrompted &&
|
|
68
|
-
(await wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER],
|
|
69
|
-
// "Do you want to enable Logs", sometimes doesn't work as `Logs` can be printed in bold.
|
|
70
|
-
'to send your application logs to Sentry?'));
|
|
71
|
-
const examplePagePrompted = logOptionPrompted &&
|
|
72
|
-
(await wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER], 'Do you want to create an example page', {
|
|
73
|
-
optional: true,
|
|
74
|
-
}));
|
|
75
|
-
// Handle the MCP prompt (default is now Yes, so press DOWN to select No)
|
|
76
|
-
const mcpPrompted = examplePagePrompted &&
|
|
77
|
-
(await wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER], 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?', {
|
|
78
|
-
optional: true,
|
|
79
|
-
}));
|
|
80
|
-
// Now wait for the success message
|
|
81
|
-
mcpPrompted &&
|
|
82
|
-
(await wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.DOWN, utils_1.KEYS.ENTER], 'Successfully installed the Sentry Nuxt SDK!'));
|
|
83
|
-
wizardInstance.kill();
|
|
84
|
-
}
|
|
85
|
-
function testNuxtProjectSetup(projectDir) {
|
|
86
|
-
const integration = Constants_1.Integration.nuxt;
|
|
87
78
|
(0, vitest_1.test)('package.json is updated correctly', () => {
|
|
88
|
-
(0, utils_1.checkPackageJson)(projectDir,
|
|
79
|
+
(0, utils_1.checkPackageJson)(projectDir, '@sentry/nuxt');
|
|
89
80
|
});
|
|
90
81
|
(0, vitest_1.test)('.env-sentry-build-plugin is created and contains the auth token', () => {
|
|
91
82
|
(0, utils_1.checkEnvBuildPlugin)(projectDir);
|
|
@@ -98,8 +89,6 @@ function testNuxtProjectSetup(projectDir) {
|
|
|
98
89
|
(0, utils_1.checkFileExists)(`${projectDir}/pages/sentry-example-page.vue`);
|
|
99
90
|
(0, utils_1.checkFileExists)(`${projectDir}/server/api/sentry-example-api.ts`);
|
|
100
91
|
});
|
|
101
|
-
}
|
|
102
|
-
function testNuxtProjectConfigs(projectDir) {
|
|
103
92
|
(0, vitest_1.test)('nuxt config contains sentry module', () => {
|
|
104
93
|
(0, utils_1.checkFileContents)(path.resolve(projectDir, 'nuxt.config.ts'), [
|
|
105
94
|
"modules: ['@sentry/nuxt/module'],",
|
|
@@ -158,13 +147,11 @@ function testNuxtProjectConfigs(projectDir) {
|
|
|
158
147
|
'});',
|
|
159
148
|
]);
|
|
160
149
|
});
|
|
161
|
-
}
|
|
162
|
-
function testNuxtProjectBuildsAndRuns(projectDir) {
|
|
163
150
|
(0, vitest_1.test)('builds successfully', async () => {
|
|
164
151
|
await (0, utils_1.checkIfBuilds)(projectDir);
|
|
165
152
|
});
|
|
166
153
|
(0, vitest_1.test)('runs on prod mode correctly', async () => {
|
|
167
154
|
await (0, utils_1.checkIfRunsOnProdMode)(projectDir, 'Listening on');
|
|
168
155
|
});
|
|
169
|
-
}
|
|
156
|
+
});
|
|
170
157
|
//# sourceMappingURL=nuxt-3.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nuxt-3.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/nuxt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AC1B,8EAA8E;YAC9E,8DAA8D;YAC9D,kCAAkC;YAClC,gFAAgF;YAChF,qCAAqC;YACrC,kCAAkC;YAClC,2EAA2E;YAC3E,+CAA+C;YAC/C,uCAAuC;YACvC,qBAAqB;YACrB,uEAAuE;YACvE,oGAAoG;YACpG,yBAAyB;YACzB,+GAA+G;YAC/G,iBAAiB;YACjB,KAAK;SACN,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,kCAAkC,EAAE,GAAG,EAAE;QAC5C,IAAA,yBAAiB,EAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,yBAAyB,CAAC,EAAE;YACrE,yCAAyC;YACzC,eAAe;YACf,WAAW,iBAAS,CAAC,WAAW,IAAI;YACpC,8EAA8E;YAC9E,wBAAwB;YACxB,0BAA0B;YAC1B,uCAAuC;YACvC,qBAAqB;YACrB,uEAAuE;YACvE,oGAAoG;YACpG,yBAAyB;YACzB,+GAA+G;YAC/G,iBAAiB;YACjB,KAAK;SACN,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,4BAA4B,CAAC,UAAkB;IACtD,IAAA,aAAI,EAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,IAAA,qBAAa,EAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,IAAA,6BAAqB,EAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import * as path from 'node:path';\nimport { Integration } from '../../lib/Constants';\nimport {\n KEYS,\n TEST_ARGS,\n checkEnvBuildPlugin,\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnProdMode,\n checkPackageJson,\n cleanupGit,\n revertLocalChanges,\n startWizardInstance,\n} from '../utils';\nimport { afterAll, beforeAll, describe, test } from 'vitest';\n\ndescribe('Nuxt-3', () => {\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/nuxt-3-test-app',\n );\n\n beforeAll(async () => {\n await runWizardOnNuxtProject(projectDir);\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n testNuxtProjectSetup(projectDir);\n\n testNuxtProjectConfigs(projectDir);\n\n testNuxtProjectBuildsAndRuns(projectDir);\n});\n\nasync function runWizardOnNuxtProject(projectDir: string): Promise<void> {\n const integration = Integration.nuxt;\n\n const wizardInstance = startWizardInstance(integration, projectDir);\n const packageManagerPrompted = await wizardInstance.waitForOutput(\n 'Please select your package manager.',\n );\n\n const nftOverridePrompted =\n packageManagerPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Selecting `yarn` as the package manager\n [KEYS.DOWN, KEYS.ENTER],\n 'Do you want to add an override for @vercel/nft version ^0.27.4?',\n {\n timeout: 240_000,\n },\n ));\n\n const deploymentPlatformPrompted =\n nftOverridePrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n KEYS.ENTER,\n 'Please select your deployment platform.',\n {\n timeout: 240_000,\n },\n ));\n\n const tracingOptionPrompted =\n deploymentPlatformPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n KEYS.ENTER,\n // \"Do you want to enable Tracing\", sometimes doesn't work as `Tracing` can be printed in bold.\n 'Do you want to enable',\n {\n timeout: 240_000,\n },\n ));\n\n const replayOptionPrompted =\n tracingOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n KEYS.ENTER,\n // \"Do you want to enable Sentry Session Replay\", sometimes doesn't work as `Sentry Session Replay` can be printed in bold.\n 'to get a video-like reproduction of errors during a user session?',\n ));\n\n const logOptionPrompted =\n replayOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Logs\", sometimes doesn't work as `Logs` can be printed in bold.\n 'to send your application logs to Sentry?',\n ));\n\n const examplePagePrompted =\n logOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Do you want to create an example page',\n {\n optional: true,\n },\n ));\n\n // Handle the MCP prompt (default is now Yes, so press DOWN to select No)\n const mcpPrompted =\n examplePagePrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n {\n optional: true,\n },\n ));\n\n // Now wait for the success message\n mcpPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.DOWN, KEYS.ENTER],\n 'Successfully installed the Sentry Nuxt SDK!',\n ));\n\n wizardInstance.kill();\n}\n\nfunction testNuxtProjectSetup(projectDir: string) {\n const integration = Integration.nuxt;\n\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, integration);\n });\n\n test('.env-sentry-build-plugin is created and contains the auth token', () => {\n checkEnvBuildPlugin(projectDir);\n });\n\n test('config files created', () => {\n checkFileExists(`${projectDir}/sentry.server.config.ts`);\n checkFileExists(`${projectDir}/sentry.client.config.ts`);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/pages/sentry-example-page.vue`);\n checkFileExists(`${projectDir}/server/api/sentry-example-api.ts`);\n });\n}\n\nfunction testNuxtProjectConfigs(projectDir: string) {\n test('nuxt config contains sentry module', () => {\n checkFileContents(path.resolve(projectDir, 'nuxt.config.ts'), [\n \"modules: ['@sentry/nuxt/module'],\",\n 'sentry: {',\n ` org: '${TEST_ARGS.ORG_SLUG}',`,\n ` project: '${TEST_ARGS.PROJECT_SLUG}'`,\n '},',\n 'sourcemap: {',\n \" client: 'hidden'\",\n '}',\n ]);\n });\n\n test('sentry.client.config.ts contents', () => {\n checkFileContents(path.resolve(projectDir, 'sentry.client.config.ts'), [\n 'import * as Sentry from \"@sentry/nuxt\";',\n 'Sentry.init({',\n ' // If set up, you can use your runtime config here',\n ' // dsn: useRuntimeConfig().public.sentry.dsn,',\n ` dsn: \"${TEST_ARGS.PROJECT_DSN}\",`,\n ' // We recommend adjusting this value in production, or using tracesSampler',\n ' // for finer control',\n ' tracesSampleRate: 1.0,',\n ' // This sets the sample rate to be 10%. You may want this to be 100% while',\n ' // in development and sample at a lower rate in production',\n ' replaysSessionSampleRate: 0.1,',\n ' // If the entire session is not sampled, use the below sample rate to sample',\n ' // sessions when an error occurs.',\n ' replaysOnErrorSampleRate: 1.0,',\n \" // If you don't want to use Session Replay, just remove the line below:\",\n ' integrations: [Sentry.replayIntegration()],',\n ' // Enable logs to be sent to Sentry',\n ' enableLogs: true,',\n ` // Enable sending of user PII (Personally Identifiable Information)`,\n ' // https://docs.sentry.io/platforms/javascript/guides/nuxt/configuration/options/#sendDefaultPii',\n ' sendDefaultPii: true,',\n \" // Setting this option to true will print useful information to the console while you're setting up Sentry.\",\n ' debug: false,',\n '});',\n ]);\n });\n\n test('sentry.server.config.ts contents', () => {\n checkFileContents(path.resolve(projectDir, 'sentry.server.config.ts'), [\n 'import * as Sentry from \"@sentry/nuxt\";',\n 'Sentry.init({',\n ` dsn: \"${TEST_ARGS.PROJECT_DSN}\",`,\n ' // We recommend adjusting this value in production, or using tracesSampler',\n ' // for finer control',\n ' tracesSampleRate: 1.0,',\n ' // Enable logs to be sent to Sentry',\n ' enableLogs: true,',\n ' // Enable sending of user PII (Personally Identifiable Information)',\n ' // https://docs.sentry.io/platforms/javascript/guides/nuxt/configuration/options/#sendDefaultPii',\n ' sendDefaultPii: true,',\n \" // Setting this option to true will print useful information to the console while you're setting up Sentry.\",\n ' debug: false,',\n '});',\n ]);\n });\n}\n\nfunction testNuxtProjectBuildsAndRuns(projectDir: string) {\n test('builds successfully', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(projectDir, 'Listening on');\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nuxt-3.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/nuxt-3.test.ts"],"names":[],"mappings":";;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BAA0B;YAC1B,uCAAuC;YACvC,qBAAqB;YACrB,uEAAuE;YACvE,oGAAoG;YACpG,yBAAyB;YACzB,+GAA+G;YAC/G,iBAAiB;YACjB,KAAK;SACN,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,IAAA,qBAAa,EAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,IAAA,6BAAqB,EAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import * as path from 'node:path';\nimport { Integration } from '../../lib/Constants';\nimport {\n TEST_ARGS,\n checkEnvBuildPlugin,\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnProdMode,\n checkPackageJson,\n createIsolatedTestEnv,\n getWizardCommand,\n} from '../utils';\nimport { afterAll, beforeAll, describe, expect, test } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('Nuxt-3', () => {\n let wizardExitCode: number;\n const { projectDir, cleanup } = createIsolatedTestEnv('nuxt-3-test-app');\n\n beforeAll(async () => {\n wizardExitCode = await withEnv({\n cwd: projectDir,\n })\n .defineInteraction()\n .expectOutput(\n 'The Sentry Nuxt Wizard will help you set up Sentry for your application',\n )\n .whenAsked('Please select your package manager.')\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .whenAsked('Do you want to add an override for @vercel/nft')\n .respondWith(KEYS.ENTER)\n .expectOutput('Installing @sentry/nuxt')\n .expectOutput('Installed @sentry/nuxt', {\n timeout: 240_000,\n })\n .expectOutput('Created .env.sentry-build-plugin')\n .whenAsked('Please select your deployment platform')\n .respondWith(KEYS.DOWN, KEYS.DOWN, KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Added Sentry Nuxt Module to nuxt.config.ts')\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER)\n .whenAsked('Do you want to enable Session Replay')\n .respondWith(KEYS.ENTER)\n .whenAsked('Do you want to enable Logs')\n .respondWith(KEYS.ENTER)\n .expectOutput('Created new sentry.server.config.ts')\n .expectOutput('Created new sentry.client.config.ts')\n .whenAsked('Do you want to create an example page')\n .respondWith(KEYS.ENTER)\n .expectOutput('Created pages/index.vue')\n .expectOutput(\n 'After building your Nuxt app, you need to --import the Sentry server config file when running your app',\n )\n .whenAsked('Do you want to open the docs?')\n .respondWith(KEYS.RIGHT, KEYS.ENTER) // no\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Successfully installed the Sentry Nuxt SDK!')\n .run(getWizardCommand(Integration.nuxt));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n test('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, '@sentry/nuxt');\n });\n\n test('.env-sentry-build-plugin is created and contains the auth token', () => {\n checkEnvBuildPlugin(projectDir);\n });\n\n test('config files created', () => {\n checkFileExists(`${projectDir}/sentry.server.config.ts`);\n checkFileExists(`${projectDir}/sentry.client.config.ts`);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/pages/sentry-example-page.vue`);\n checkFileExists(`${projectDir}/server/api/sentry-example-api.ts`);\n });\n\n test('nuxt config contains sentry module', () => {\n checkFileContents(path.resolve(projectDir, 'nuxt.config.ts'), [\n \"modules: ['@sentry/nuxt/module'],\",\n 'sentry: {',\n ` org: '${TEST_ARGS.ORG_SLUG}',`,\n ` project: '${TEST_ARGS.PROJECT_SLUG}'`,\n '},',\n 'sourcemap: {',\n \" client: 'hidden'\",\n '}',\n ]);\n });\n\n test('sentry.client.config.ts contents', () => {\n checkFileContents(path.resolve(projectDir, 'sentry.client.config.ts'), [\n 'import * as Sentry from \"@sentry/nuxt\";',\n 'Sentry.init({',\n ' // If set up, you can use your runtime config here',\n ' // dsn: useRuntimeConfig().public.sentry.dsn,',\n ` dsn: \"${TEST_ARGS.PROJECT_DSN}\",`,\n ' // We recommend adjusting this value in production, or using tracesSampler',\n ' // for finer control',\n ' tracesSampleRate: 1.0,',\n ' // This sets the sample rate to be 10%. You may want this to be 100% while',\n ' // in development and sample at a lower rate in production',\n ' replaysSessionSampleRate: 0.1,',\n ' // If the entire session is not sampled, use the below sample rate to sample',\n ' // sessions when an error occurs.',\n ' replaysOnErrorSampleRate: 1.0,',\n \" // If you don't want to use Session Replay, just remove the line below:\",\n ' integrations: [Sentry.replayIntegration()],',\n ' // Enable logs to be sent to Sentry',\n ' enableLogs: true,',\n ` // Enable sending of user PII (Personally Identifiable Information)`,\n ' // https://docs.sentry.io/platforms/javascript/guides/nuxt/configuration/options/#sendDefaultPii',\n ' sendDefaultPii: true,',\n \" // Setting this option to true will print useful information to the console while you're setting up Sentry.\",\n ' debug: false,',\n '});',\n ]);\n });\n\n test('sentry.server.config.ts contents', () => {\n checkFileContents(path.resolve(projectDir, 'sentry.server.config.ts'), [\n 'import * as Sentry from \"@sentry/nuxt\";',\n 'Sentry.init({',\n ` dsn: \"${TEST_ARGS.PROJECT_DSN}\",`,\n ' // We recommend adjusting this value in production, or using tracesSampler',\n ' // for finer control',\n ' tracesSampleRate: 1.0,',\n ' // Enable logs to be sent to Sentry',\n ' enableLogs: true,',\n ' // Enable sending of user PII (Personally Identifiable Information)',\n ' // https://docs.sentry.io/platforms/javascript/guides/nuxt/configuration/options/#sendDefaultPii',\n ' sendDefaultPii: true,',\n \" // Setting this option to true will print useful information to the console while you're setting up Sentry.\",\n ' debug: false,',\n '});',\n ]);\n });\n\n test('builds successfully', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(projectDir, 'Listening on');\n });\n});\n"]}
|