@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":"angular-19.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/angular-19.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAkD;AAClD,oCAakB;AAClB,2CAA6B;AAC7B,oCAAqC;AACrC,mCAAqE;AAErE,iBAAQ,CAAC,UAAU,CAAC,YAAY,EAAE,GAAG,EAAE;IACrC,IAAA,iBAAQ,EAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,MAAM,WAAW,GAAG,uBAAW,CAAC,OAAO,CAAC;QACxC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAC7B,SAAS,EACT,0CAA0C,CAC3C,CAAC;QAEF,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;YACnB,IAAA,0BAAkB,EAAC,UAAU,CAAC,CAAC;YAC/B,MAAM,yBAAyB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;QAEH,IAAA,iBAAQ,EAAC,GAAG,EAAE;YACZ,IAAA,0BAAkB,EAAC,UAAU,CAAC,CAAC;YAC/B,IAAA,kBA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b,CAAC,CAAC;4CACkC;YACtC;qBACe;YACf;;OAEC;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;QACnD,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACjE,IAAA,uBAAe,EAAC,eAAe,CAAC,CAAC;QAEjC,8DAA8D;QAC9D,MAAM,WAAW,GAAG,CAAC,MAAM,MAAM,CAAC,eAAe,CAAC,CAAwB,CAAC;QAE3E,8DAA8D;QAC9D,KAAK,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO;QACtC,8DAA8D;QAC9D,WAAW,CAAC,QAA+B,CAC5C,EAAE;YACD,IAAA,eAAM;YACJ,sEAAsE;YACtE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,CACjE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACd;IACH,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,EACzB,UAAU,EACV,yCAAyC,CAC1C,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,IAAA,4BAAoB,EACxB,UAAU,EACV,yCAAyC,CAC1C,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Integration } from '../../lib/Constants';\nimport {\n checkFileContents,\n checkFileDoesNotContain,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n cleanupGit,\n KEYS,\n modifyFile,\n revertLocalChanges,\n startWizardInstance,\n} from '../utils';\nimport * as path from 'path';\nimport { TEST_ARGS } from '../utils';\nimport { test, expect, describe, beforeAll, afterAll } from 'vitest';\n\ndescribe.sequential('Angular-19', () => {\n describe('with empty project', () => {\n const integration = Integration.angular;\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/angular-19-test-app',\n );\n\n beforeAll(async () => {\n revertLocalChanges(projectDir);\n await runWizardOnAngularProject(projectDir, integration);\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n checkAngularProject(projectDir, integration);\n });\n describe('with pre-defined ErrorHandler', () => {\n const integration = Integration.angular;\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/angular-19-test-app',\n );\n\n beforeAll(async () => {\n revertLocalChanges(projectDir);\n await runWizardOnAngularProject(projectDir, integration, (projectDir) => {\n modifyFile(`${projectDir}/src/app/app.config.ts`, {\n 'providers: [': `providers: [{\n provide: ErrorHandler,\n useValue: null\n },\n `,\n });\n });\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n checkAngularProject(projectDir, integration, {\n preExistingErrorHandler: true,\n });\n });\n});\n\nasync function runWizardOnAngularProject(\n projectDir: string,\n integration: Integration,\n fileModificationFn?: (projectDir: string) => unknown,\n) {\n const wizardInstance = startWizardInstance(integration, projectDir, true);\n\n if (fileModificationFn) {\n fileModificationFn(projectDir);\n\n await wizardInstance.waitForOutput('Do you want to continue anyway?');\n\n await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Please select your package manager.',\n );\n } else {\n await wizardInstance.waitForOutput('Please select your package manager.');\n }\n\n await wizardInstance.sendStdinAndWaitForOutput(\n // Selecting `yarn` as the package manager\n [KEYS.DOWN, 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 timeout: 240_000,\n optional: true,\n },\n );\n\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 await wizardInstance.sendStdinAndWaitForOutput(\n // select \"Yes\" for replay\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 await wizardInstance.sendStdinAndWaitForOutput(\n // select \"Yes\" for logs\n [KEYS.ENTER],\n 'Where are your build artifacts located?',\n {\n optional: true,\n timeout: 5000,\n },\n );\n\n const sourcemapsConfiguredPromise = wizardInstance.waitForOutput(\n 'Added a sentry:sourcemaps script to your package.json',\n );\n\n const buildScriptPromptedPromise = wizardInstance.waitForOutput(\n 'Do you want to automatically run the sentry:sourcemaps script after each production build?',\n );\n\n const optionalArtifactsNotFoundPromise = wizardInstance.waitForOutput(\n \"We couldn't find build artifacts at\",\n {\n optional: true,\n timeout: 5000,\n },\n );\n\n // ./dist is the default value, no need to change it\n wizardInstance.sendStdin(KEYS.ENTER);\n\n const optionalArtifactsNotFoundPrompted =\n await optionalArtifactsNotFoundPromise;\n\n if (optionalArtifactsNotFoundPrompted) {\n // The wizard now presents options when artifacts aren't found:\n // - \"Let the wizard run the build command\"\n // - \"Enter a different path manually\"\n // - \"Proceed anyway — I believe the path is correct\"\n // We want to select \"Proceed anyway\" (third option)\n wizardInstance.sendStdin(KEYS.DOWN);\n wizardInstance.sendStdin(KEYS.DOWN);\n wizardInstance.sendStdin(KEYS.ENTER);\n }\n\n await sourcemapsConfiguredPromise;\n await buildScriptPromptedPromise;\n\n await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER], // yes, automatically add sentry:sourcemaps script\n 'Is yarn build your production build command?',\n );\n\n await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER], // yes, yarn build is the production build command\n 'Are you using a CI/CD tool to build and deploy your application?',\n );\n\n await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.DOWN, KEYS.ENTER], // no CI/CD tool\n 'Do you want to create an example component to test your Sentry setup?',\n );\n\n await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER], // yes, create example component\n 'Did you apply the snippet above?',\n );\n\n await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER], // yes, applied the snippet\n 'Looks like you have Prettier in your project. Do you want to run it on your files?',\n );\n\n await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER], // yes, run prettier\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n {\n optional: true,\n },\n );\n\n // Handle the MCP prompt (default is now Yes, so press DOWN to select No)\n await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.DOWN, KEYS.ENTER], // decline MCP config\n 'Successfully installed the Sentry Angular SDK!',\n );\n\n wizardInstance.kill();\n}\n\nfunction checkAngularProject(\n projectDir: string,\n integration: Integration,\n options?: {\n preExistingErrorHandler?: boolean;\n },\n) {\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, integration);\n\n const packageJsonFile = path.resolve(projectDir, 'package.json');\n checkFileContents(packageJsonFile, [\n `\"sentry:sourcemaps\": \"sentry-cli sourcemaps inject --org ${TEST_ARGS.ORG_SLUG} --project ${TEST_ARGS.PROJECT_SLUG} ./dist && sentry-cli sourcemaps upload --org ${TEST_ARGS.ORG_SLUG} --project ${TEST_ARGS.PROJECT_SLUG} ./dist\"`,\n `\"build\": \"ng build && yarn sentry:sourcemaps\"`,\n ]);\n });\n\n test('Sentry is correctly injected into Angular app config', () => {\n const appConfigFile = path.resolve(projectDir, 'src/main.ts');\n checkFileExists(appConfigFile);\n\n checkFileContents(appConfigFile, [\n `import * as Sentry from '@sentry/angular'`,\n 'Sentry.init({',\n TEST_ARGS.PROJECT_DSN,\n 'Sentry.browserTracingIntegration()',\n 'Sentry.replayIntegration()',\n 'tracesSampleRate: 1',\n 'replaysSessionSampleRate: 0.1',\n 'replaysOnErrorSampleRate: 1',\n 'enableLogs: true',\n 'sendDefaultPii: true',\n ]);\n });\n\n test('Sentry is correctly injected into Angular app module', () => {\n const appModuleFile = path.resolve(projectDir, 'src/app/app.config.ts');\n checkFileExists(appModuleFile);\n\n // Checking if the ErrorHandler is already present in the providers array,\n // and if it is, we skip adding it\n if (options?.preExistingErrorHandler) {\n checkFileDoesNotContain(appModuleFile, 'Sentry.createErrorHandler()');\n }\n\n checkFileContents(appModuleFile, [\n `import * as Sentry from '@sentry/angular'`,\n options?.preExistingErrorHandler\n ? `provide: ErrorHandler,\n useValue: null`\n : `provide: ErrorHandler,\n useValue: Sentry.createErrorHandler()`,\n `provide: Sentry.TraceService,\n deps: [Router]`,\n `provideAppInitializer(() => {\n inject(Sentry.TraceService);\n })`,\n ]);\n });\n\n test('angular.json is updated correctly', async () => {\n const angularJsonFile = path.resolve(projectDir, 'angular.json');\n checkFileExists(angularJsonFile);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const angularJson = (await import(angularJsonFile)) as Record<string, any>;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n for (const [, project] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n angularJson.projects as Record<string, any>,\n )) {\n expect(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n project?.architect?.build?.configurations?.production?.sourceMap,\n ).toBe(true);\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(\n projectDir,\n 'Application bundle generation complete.',\n );\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(\n projectDir,\n 'Application bundle generation complete.',\n );\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"angular-19.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/angular-19.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAkD;AACl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AAC,CAAC;AACL,CAAC","sourcesContent":["import { Integration } from '../../lib/Constants';\nimport {\n checkFileContents,\n checkFileDoesNotContain,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n createIsolatedTestEnv,\n getWizardCommand,\n modifyFile,\n} from '../utils';\nimport * as path from 'path';\nimport { TEST_ARGS } from '../utils';\nimport { test, expect, describe, beforeAll, afterAll, it } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe.sequential('Angular-19', () => {\n describe('with empty project', () => {\n const integration = Integration.angular;\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv(\n 'angular-19-test-app',\n );\n\n beforeAll(async () => {\n wizardExitCode = await runWizardOnAngularProject(projectDir, integration);\n });\n\n afterAll(() => {\n cleanup();\n });\n\n it('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n checkAngularProject(projectDir, integration);\n });\n\n describe('with pre-defined ErrorHandler', () => {\n const integration = Integration.angular;\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv(\n 'angular-19-test-app',\n );\n\n beforeAll(async () => {\n wizardExitCode = await runWizardOnAngularProject(\n projectDir,\n integration,\n (projectDir) => {\n modifyFile(`${projectDir}/src/app/app.config.ts`, {\n 'providers: [': `providers: [{\n provide: ErrorHandler,\n useValue: null\n },\n `,\n });\n },\n );\n });\n\n afterAll(() => {\n cleanup();\n });\n\n it('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n checkAngularProject(projectDir, integration, {\n preExistingErrorHandler: true,\n });\n });\n});\n\nasync function runWizardOnAngularProject(\n projectDir: string,\n integration: Integration,\n fileModificationFn?: (projectDir: string) => unknown,\n): Promise<number> {\n const wizardInteraction = withEnv({\n cwd: projectDir,\n }).defineInteraction();\n\n if (fileModificationFn) {\n fileModificationFn(projectDir);\n\n wizardInteraction\n .whenAsked('Do you want to continue anyway?')\n .respondWith(KEYS.ENTER);\n }\n return (\n wizardInteraction\n .whenAsked('Please select your package manager.')\n .respondWith(KEYS.ENTER) // npm is the default for Angular\n .expectOutput('Installing @sentry/angular')\n // Installing the sdk can take a while in CI\n .expectOutput('Installed @sentry/angular with NPM.', {\n timeout: 240_000,\n })\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked('Do you want to enable Session Replay')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked('Do you want to enable Logs')\n .respondWith(KEYS.ENTER) // yes\n .expectOutput('initialized Sentry in main.ts', {\n timeout: 10_000,\n })\n .expectOutput('updated your app config app.config.ts')\n .expectOutput('Installing @sentry/cli')\n .expectOutput('Installed @sentry/cli@', {\n timeout: 240_000, // installing Sentry CLI can take a while in CI\n })\n .whenAsked('Where are your build artifacts located?')\n .respondWith(KEYS.ENTER) // ./dist is the default value\n .whenAsked(\n 'We couldn\\'t find build artifacts at \"./dist\". What would you like to do?',\n )\n .respondWith(KEYS.DOWN, KEYS.DOWN, KEYS.ENTER) // Proceed anyway (this is expected)\n .whenAsked(\n 'Do you want to automatically run the sentry:sourcemaps script after each production build?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER) // no - we can't upload in CI when testing building\n .whenAsked(\n 'Are you using a CI/CD tool to build and deploy your application?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Add a step to your CI pipeline that runs the sentry:sourcemaps script right after building your application',\n )\n .respondWith(KEYS.ENTER)\n .expectOutput(\n 'Add the Sentry authentication token as an environment variable to your CI setup:',\n )\n .expectOutput('SENTRY_AUTH_TOKEN=')\n .whenAsked('Did you configure CI as shown above?')\n .respondWith(KEYS.ENTER) // yes\n .whenAsked(\n 'Do you want to create an example component to test your Sentry setup?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('Did you apply the snippet above?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Looks like you have Prettier in your project. Do you want to run it on your files?',\n )\n .respondWith(KEYS.ENTER)\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 Angular SDK!')\n .run(getWizardCommand(integration))\n );\n}\n\nfunction checkAngularProject(\n projectDir: string,\n integration: Integration,\n options?: {\n preExistingErrorHandler?: boolean;\n },\n) {\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, '@sentry/angular');\n\n const packageJsonFile = path.resolve(projectDir, 'package.json');\n checkFileContents(packageJsonFile, [\n `\"sentry:sourcemaps\": \"sentry-cli sourcemaps inject --org ${TEST_ARGS.ORG_SLUG} --project ${TEST_ARGS.PROJECT_SLUG} ./dist && sentry-cli sourcemaps upload --org ${TEST_ARGS.ORG_SLUG} --project ${TEST_ARGS.PROJECT_SLUG} ./dist\"`,\n `\"build\": \"ng build\"`,\n ]);\n });\n\n test('Sentry is correctly injected into Angular app config', () => {\n const appConfigFile = path.resolve(projectDir, 'src/main.ts');\n checkFileExists(appConfigFile);\n\n checkFileContents(appConfigFile, [\n `import * as Sentry from \"@sentry/angular\";`,\n 'Sentry.init({',\n TEST_ARGS.PROJECT_DSN,\n 'Sentry.browserTracingIntegration()',\n 'Sentry.replayIntegration()',\n 'tracesSampleRate: 1',\n 'replaysSessionSampleRate: 0.1',\n 'replaysOnErrorSampleRate: 1',\n 'enableLogs: true',\n 'sendDefaultPii: true',\n ]);\n });\n\n test('Sentry is correctly injected into Angular app module', () => {\n const appModuleFile = path.resolve(projectDir, 'src/app/app.config.ts');\n checkFileExists(appModuleFile);\n\n // Checking if the ErrorHandler is already present in the providers array,\n // and if it is, we skip adding it\n if (options?.preExistingErrorHandler) {\n checkFileDoesNotContain(appModuleFile, 'Sentry.createErrorHandler()');\n }\n\n checkFileContents(appModuleFile, [\n `import * as Sentry from \"@sentry/angular\";`,\n options?.preExistingErrorHandler\n ? `provide: ErrorHandler,\n useValue: null`\n : `provide: ErrorHandler,\n useValue: Sentry.createErrorHandler()`,\n `provide: Sentry.TraceService,\n deps: [Router]`,\n `provideAppInitializer(() => {\n inject(Sentry.TraceService);\n })`,\n ]);\n });\n\n test('angular.json is updated correctly', async () => {\n const angularJsonFile = path.resolve(projectDir, 'angular.json');\n checkFileExists(angularJsonFile);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const angularJson = (await import(angularJsonFile)) as Record<string, any>;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n for (const [, project] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n angularJson.projects as Record<string, any>,\n )) {\n expect(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n project?.architect?.build?.configurations?.production?.sourceMap,\n ).toBe(true);\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(\n projectDir,\n 'Application bundle generation complete.',\n );\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(\n projectDir,\n 'Application bundle generation complete.',\n );\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const Constants_1 = require("../../lib/Constants");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
//@ts-expect-error - clifty is ESM only
|
|
7
|
+
const clifty_1 = require("clifty");
|
|
8
|
+
(0, vitest_1.describe)('cloudflare-worker', () => {
|
|
9
|
+
const integration = Constants_1.Integration.cloudflare;
|
|
10
|
+
let wizardExitCode;
|
|
11
|
+
let expectedCompatibilityDate;
|
|
12
|
+
const { projectDir, cleanup } = (0, utils_1.createIsolatedTestEnv)('cloudflare-test-app');
|
|
13
|
+
(0, vitest_1.beforeAll)(async () => {
|
|
14
|
+
// Capture the date before running the wizard (wizard runs in subprocess)
|
|
15
|
+
expectedCompatibilityDate = new Date().toISOString().slice(0, 10);
|
|
16
|
+
wizardExitCode = await (0, clifty_1.withEnv)({
|
|
17
|
+
cwd: projectDir,
|
|
18
|
+
})
|
|
19
|
+
.defineInteraction()
|
|
20
|
+
.expectOutput('The Sentry Cloudflare Wizard will help you set up Sentry for your application')
|
|
21
|
+
.step('package installation', ({ expectOutput, whenAsked }) => {
|
|
22
|
+
whenAsked('Please select your package manager.').respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER);
|
|
23
|
+
expectOutput('Installing @sentry/cloudflare');
|
|
24
|
+
})
|
|
25
|
+
.step('SDK setup', ({ whenAsked }) => {
|
|
26
|
+
whenAsked('Do you want to enable Tracing', {
|
|
27
|
+
timeout: 90000, // package installation can take a while in CI
|
|
28
|
+
}).respondWith(clifty_1.KEYS.ENTER);
|
|
29
|
+
})
|
|
30
|
+
.whenAsked('Optionally add a project-scoped MCP server configuration for the Sentry MCP?')
|
|
31
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER)
|
|
32
|
+
.expectOutput('Sentry has been successfully configured for your Cloudflare project.')
|
|
33
|
+
.run((0, utils_1.getWizardCommand)(integration));
|
|
34
|
+
});
|
|
35
|
+
(0, vitest_1.afterAll)(() => {
|
|
36
|
+
cleanup();
|
|
37
|
+
});
|
|
38
|
+
(0, vitest_1.it)('exits with exit code 0', () => {
|
|
39
|
+
(0, vitest_1.expect)(wizardExitCode).toBe(0);
|
|
40
|
+
});
|
|
41
|
+
(0, vitest_1.it)('adds the SDK dependency to package.json', () => {
|
|
42
|
+
(0, utils_1.checkPackageJson)(projectDir, '@sentry/cloudflare');
|
|
43
|
+
});
|
|
44
|
+
(0, vitest_1.it)('builds correctly', async () => {
|
|
45
|
+
await (0, utils_1.checkIfBuilds)(projectDir);
|
|
46
|
+
});
|
|
47
|
+
(0, vitest_1.it)('wrangler.jsonc file contains Sentry configuration', () => {
|
|
48
|
+
(0, utils_1.checkFileContents)(`${projectDir}/wrangler.jsonc`, [
|
|
49
|
+
`"compatibility_date": "${expectedCompatibilityDate}"`,
|
|
50
|
+
'"global_fetch_strictly_public"',
|
|
51
|
+
'"nodejs_als"',
|
|
52
|
+
'"version_metadata": {',
|
|
53
|
+
'"binding": "CF_VERSION_METADATA"',
|
|
54
|
+
]);
|
|
55
|
+
});
|
|
56
|
+
(0, vitest_1.it)('modifies the worker file to include Sentry initialization', () => {
|
|
57
|
+
(0, utils_1.checkFileContents)(`${projectDir}/src/index.ts`, [
|
|
58
|
+
'import * as Sentry from "@sentry/cloudflare";',
|
|
59
|
+
'export default Sentry.withSentry(env => ({',
|
|
60
|
+
'dsn: "https://public@dsn.ingest.sentry.io/1337",',
|
|
61
|
+
]);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=cloudflare-worker.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudflare-worker.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/cloudflare-worker.test.ts"],"names":[],"mappings":";;AAAA,mCAAmE;AACnE,mDAAkD;AAClD,oCAMkB;AAElB,uCAAuC;AACvC,mCAAuC;AAEvC,IAAA,iBAAQ,EAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,MAAM,WAAW,GAAG,uBAAW,CAAC,UAAU,CAAC;IAC3C,IAAI,cAAsB,CAAC;IAC3B,IAAI,yBAAiC,CAAC;IAEtC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,6BAAqB,EAAC,qBAAqB,CAAC,CAAC;IAE7E,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;QACnB,yEAAyE;QACzE,yBAAyB,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAElE,cAAc,GAAG,MAAM,IAAA,gBAAO,EAAC;YAC7B,GAAG,EAAE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AC;IAEH,IAAA,WAAE,EAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,IAAA,yBAAiB,EAAC,GAAG,UAAU,iBAAiB,EAAE;YAChD,0BAA0B,yBAAyB,GAAG;YACtD,gCAAgC;YAChC,cAAc;YACd,uBAAuB;YACvB,kCAAkC;SACnC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,IAAA,yBAAiB,EAAC,GAAG,UAAU,eAAe,EAAE;YAC9C,+CAA+C;YAC/C,4CAA4C;YAC5C,kDAAkD;SACnD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { afterAll, beforeAll, describe, expect, it } from 'vitest';\nimport { Integration } from '../../lib/Constants';\nimport {\n checkFileContents,\n checkIfBuilds,\n checkPackageJson,\n createIsolatedTestEnv,\n getWizardCommand,\n} from '../utils';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('cloudflare-worker', () => {\n const integration = Integration.cloudflare;\n let wizardExitCode: number;\n let expectedCompatibilityDate: string;\n\n const { projectDir, cleanup } = createIsolatedTestEnv('cloudflare-test-app');\n\n beforeAll(async () => {\n // Capture the date before running the wizard (wizard runs in subprocess)\n expectedCompatibilityDate = new Date().toISOString().slice(0, 10);\n\n wizardExitCode = await withEnv({\n cwd: projectDir,\n })\n .defineInteraction()\n .expectOutput(\n 'The Sentry Cloudflare Wizard will help you set up Sentry for your application',\n )\n .step('package installation', ({ expectOutput, whenAsked }) => {\n whenAsked('Please select your package manager.').respondWith(\n KEYS.DOWN,\n KEYS.ENTER,\n );\n expectOutput('Installing @sentry/cloudflare');\n })\n .step('SDK setup', ({ whenAsked }) => {\n whenAsked('Do you want to enable Tracing', {\n timeout: 90_000, // package installation can take a while in CI\n }).respondWith(KEYS.ENTER);\n })\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput(\n 'Sentry has been successfully configured for your Cloudflare project.',\n )\n .run(getWizardCommand(integration));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n it('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n it('adds the SDK dependency to package.json', () => {\n checkPackageJson(projectDir, '@sentry/cloudflare');\n });\n\n it('builds correctly', async () => {\n await checkIfBuilds(projectDir);\n });\n\n it('wrangler.jsonc file contains Sentry configuration', () => {\n checkFileContents(`${projectDir}/wrangler.jsonc`, [\n `\"compatibility_date\": \"${expectedCompatibilityDate}\"`,\n '\"global_fetch_strictly_public\"',\n '\"nodejs_als\"',\n '\"version_metadata\": {',\n '\"binding\": \"CF_VERSION_METADATA\"',\n ]);\n });\n\n it('modifies the worker file to include Sentry initialization', () => {\n checkFileContents(`${projectDir}/src/index.ts`, [\n 'import * as Sentry from \"@sentry/cloudflare\";',\n 'export default Sentry.withSentry(env => ({',\n 'dsn: \"https://public@dsn.ingest.sentry.io/1337\",',\n ]);\n });\n});\n"]}
|
|
@@ -34,11 +34,9 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
34
34
|
//@ts-expect-error - clifty is ESM only
|
|
35
35
|
const clifty_1 = require("clifty");
|
|
36
36
|
(0, vitest_1.describe)('Cloudflare-Wrangler-Sourcemaps-Wizard', () => {
|
|
37
|
-
const projectDir = path.resolve(__dirname, '../test-applications/cloudflare-wrangler-sourcemaps-test-app');
|
|
38
37
|
let wizardExitCode;
|
|
38
|
+
const { projectDir, cleanup } = (0, utils_1.createIsolatedTestEnv)('cloudflare-wrangler-sourcemaps-test-app');
|
|
39
39
|
(0, vitest_1.beforeAll)(async () => {
|
|
40
|
-
(0, utils_1.initGit)(projectDir);
|
|
41
|
-
(0, utils_1.revertLocalChanges)(projectDir);
|
|
42
40
|
wizardExitCode = await (0, clifty_1.withEnv)({ cwd: projectDir })
|
|
43
41
|
.defineInteraction()
|
|
44
42
|
.step('intro', ({ expectOutput }) => {
|
|
@@ -68,8 +66,7 @@ const clifty_1 = require("clifty");
|
|
|
68
66
|
.run((0, utils_1.getWizardCommand)(Constants_1.Integration.sourcemaps));
|
|
69
67
|
}, 60000);
|
|
70
68
|
(0, vitest_1.afterAll)(() => {
|
|
71
|
-
(
|
|
72
|
-
(0, utils_1.cleanupGit)(projectDir);
|
|
69
|
+
cleanup();
|
|
73
70
|
});
|
|
74
71
|
(0, vitest_1.it)('exits with exit code 0', () => {
|
|
75
72
|
(0, vitest_1.expect)(wizardExitCode).toBe(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare-wrangler-sourcemaps.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/cloudflare-wrangler-sourcemaps.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAmE;AACnE,
|
|
1
|
+
{"version":3,"file":"cloudflare-wrangler-sourcemaps.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/cloudflare-wrangler-sourcemaps.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAmE;AACnE,oCAKkB;AAClB,mDAAkD;AAClD,2CAA6B;AAC7B,4CAAoB;AACpB,uCAAuC;AACvC,mCAAuC;AAGvC,IAAA,iBAAQ,EAAC,uCAAuC,EAAE,GAAG,EAAE;IACrD,IAAI,cAAsB,CAAC;IAE3B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,6BAAqB,EACnD,yCAAyC,CAC1C,CAAC;IAEF,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;QACnB,cAAc,GAAG,MAAM,IAAA,gBAAO,EAAC,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;aAChD,iBAAiB,EAAE;aACnB,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;YAClC,YAAY,CAAC,wDAAwD,CAAC,CA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B,EAAC,UAAU,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { afterAll, beforeAll, describe, expect, it } from 'vitest';\nimport {\n checkSentryCliRc,\n createIsolatedTestEnv,\n getWizardCommand,\n TEST_ARGS,\n} from '../utils';\nimport { Integration } from '../../lib/Constants';\nimport * as path from 'path';\nimport fs from 'fs';\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\nimport { PackageDotJson } from '../../src/utils/package-json';\n\ndescribe('Cloudflare-Wrangler-Sourcemaps-Wizard', () => {\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv(\n 'cloudflare-wrangler-sourcemaps-test-app',\n );\n\n beforeAll(async () => {\n wizardExitCode = await withEnv({ cwd: projectDir })\n .defineInteraction()\n .step('intro', ({ expectOutput }) => {\n expectOutput('This wizard will help you upload source maps to Sentry');\n })\n .step('select wrangler', ({ expectOutput, whenAsked }) => {\n whenAsked(\n 'Which framework, bundler or build tool are you using?',\n ).respondWith(KEYS.ENTER);\n\n expectOutput('Before we get started');\n expectOutput('We recommend using Vite to build your worker instead');\n whenAsked('want to proceed with the Wrangler setup').respondWith(\n KEYS.ENTER,\n );\n })\n .step('configure source maps upload', ({ expectOutput, whenAsked }) => {\n expectOutput('Installing @sentry/cli');\n whenAsked('Is yarn deploy your build and deploy command?', {\n timeout: 60_000, // give CI some time to install @sentry/cli\n }).respondWith(KEYS.ENTER);\n expectOutput('Added a sentry:sourcemaps script to your package.json');\n expectOutput('Added a postdeploy script to your package.json');\n expectOutput(\n 'Modified your deploy script to enable uploading source maps',\n );\n expectOutput(\n 'Added auth token to .sentryclirc for you to test uploading source maps locally',\n );\n expectOutput('Created .sentryclirc');\n })\n .step('add auth token to CI/CD (skipped)', ({ whenAsked }) => {\n whenAsked(\n 'Are you using a CI/CD tool to build and deploy your application?',\n ).respondWith(KEYS.DOWN, KEYS.ENTER); // no\n })\n .expectOutput(\"That's it\")\n .run(getWizardCommand(Integration.sourcemaps));\n }, 60_000);\n\n afterAll(() => {\n cleanup();\n });\n\n it('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n it('adds and adjusts the respective package.json scripts', () => {\n const pkgJson = JSON.parse(\n fs.readFileSync(path.join(projectDir, 'package.json'), 'utf8'),\n ) as PackageDotJson;\n\n expect(pkgJson?.scripts?.['sentry:sourcemaps']).toEqual(\n `_SENTRY_RELEASE=$(sentry-cli releases propose-version) && sentry-cli releases new $_SENTRY_RELEASE --org=${TEST_ARGS.ORG_SLUG} --project=${TEST_ARGS.PROJECT_SLUG} && sentry-cli sourcemaps upload --org=${TEST_ARGS.ORG_SLUG} --project=${TEST_ARGS.PROJECT_SLUG} --release=$_SENTRY_RELEASE --strip-prefix 'dist/..' dist`,\n );\n expect(pkgJson?.scripts?.['postdeploy']).toEqual('yarn sentry:sourcemaps');\n expect(pkgJson?.scripts?.['deploy']).toEqual(\n 'wrangler deploy --outdir dist --upload-source-maps --var SENTRY_RELEASE:$(sentry-cli releases propose-version)',\n );\n });\n\n it('adds sentry-cli as a devDependency', () => {\n const pkgJson = JSON.parse(\n fs.readFileSync(path.join(projectDir, 'package.json'), 'utf8'),\n ) as PackageDotJson;\n\n expect(pkgJson?.devDependencies?.['@sentry/cli']).toBeDefined();\n });\n\n it('adds a .sentryclirc file', () => {\n checkSentryCliRc(projectDir);\n });\n});\n"]}
|
|
@@ -1,73 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const path = __importStar(require("node:path"));
|
|
27
3
|
const Constants_1 = require("../../lib/Constants");
|
|
28
4
|
const utils_1 = require("../utils");
|
|
29
5
|
const vitest_1 = require("vitest");
|
|
6
|
+
//@ts-expect-error - clifty is ESM only
|
|
7
|
+
const clifty_1 = require("clifty");
|
|
30
8
|
(0, vitest_1.describe)('Expo', () => {
|
|
31
|
-
|
|
32
|
-
const projectDir =
|
|
9
|
+
let wizardExitCode;
|
|
10
|
+
const { projectDir, cleanup } = (0, utils_1.createIsolatedTestEnv)('react-native-expo-test-app');
|
|
33
11
|
(0, vitest_1.beforeAll)(async () => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
testEventPrompted &&
|
|
63
|
-
(await wizardInstance.sendStdinAndWaitForOutput(
|
|
64
|
-
// Respond that test event was sent
|
|
65
|
-
[utils_1.KEYS.ENTER], 'Everything is set up!'));
|
|
66
|
-
wizardInstance.kill();
|
|
12
|
+
wizardExitCode = await (0, clifty_1.withEnv)({
|
|
13
|
+
cwd: projectDir,
|
|
14
|
+
})
|
|
15
|
+
.defineInteraction()
|
|
16
|
+
.whenAsked('Please select your package manager.')
|
|
17
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER)
|
|
18
|
+
.expectOutput('Installing @sentry/react-native')
|
|
19
|
+
.expectOutput('Installed @sentry/react-native', {
|
|
20
|
+
timeout: 240000,
|
|
21
|
+
})
|
|
22
|
+
.whenAsked('Do you want to enable Session Replay')
|
|
23
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
24
|
+
.whenAsked('Do you want to enable the Feedback Widget to collect feedback from your users?')
|
|
25
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
26
|
+
.whenAsked('Do you want to enable Logs')
|
|
27
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
28
|
+
.expectOutput('Added Sentry.init to app/_layout.tsx')
|
|
29
|
+
.expectOutput('Added Sentry Expo plugin to app.config.json')
|
|
30
|
+
.expectOutput('Added .env.local to .gitignore')
|
|
31
|
+
.expectOutput('Written .env.local')
|
|
32
|
+
.expectOutput('Created metro.config.js with Sentry configuration')
|
|
33
|
+
.whenAsked('Optionally add a project-scoped MCP server configuration for the Sentry MCP?')
|
|
34
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER)
|
|
35
|
+
.expectOutput('To make sure everything is set up correctly, put the following code snippet into your application.')
|
|
36
|
+
.whenAsked('Have you successfully sent a test event?')
|
|
37
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
38
|
+
.expectOutput('Everything is set up!')
|
|
39
|
+
.run((0, utils_1.getWizardCommand)(Constants_1.Integration.reactNative));
|
|
67
40
|
});
|
|
68
41
|
(0, vitest_1.afterAll)(() => {
|
|
69
|
-
(
|
|
70
|
-
|
|
42
|
+
cleanup();
|
|
43
|
+
});
|
|
44
|
+
(0, vitest_1.test)('exits with exit code 0', () => {
|
|
45
|
+
(0, vitest_1.expect)(wizardExitCode).toBe(0);
|
|
71
46
|
});
|
|
72
47
|
(0, vitest_1.test)('package.json is updated correctly', () => {
|
|
73
48
|
(0, utils_1.checkFileContents)(`${projectDir}/package.json`, `@sentry/react-native`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expo.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/expo.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expo.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/expo.test.ts"],"names":[],"mappings":";;AAAA,mDAAkD;AAClD,oCAOkB;AAClB,mCAAqE;AAErE,uCAAuC;AACvC,mCAAuC;AAEvC,IAAA,iBAAQ,EAAC,MAAM,EAAE,GAAG,EAAE;IACpB,IAAI,cAAsB,CAAC;IAC3B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,6BAAqB,EACnD,4BAA4B,CAC7B,CAAC;IAEF,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;QACnB,cAAc,GAAG,MAAM,IAAA,gBAAO,EAAC;YAC7B,GAAG,EAAE,UAAU;SAChB,CAAC;aACC,iBAAiB,EAAE;aAEnB,SAAS,CAAC,qCAAqC,CAAC;aAChD,WAAW,CAAC,aAAI,CAAC,IAAI,EAAE,aAAI,CAAC,KAAK,CAAC;aAClC,YAAY,CAAC,iCAAiC,CAAC;aAC/C,YAAY,CAAC,gCAAgC,EAAE;YAC9C,OAAO,EAAE,MAAO;SACjB,CAAC;aAED,SAAS,CAAC,sCAAsC,CAAC;aACjD,WAAW,CAAC,aAAI,CAAC,KAAK,CAAC;aACvB,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C,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { Integration } from '../../lib/Constants';\nimport {\n TEST_ARGS,\n checkFileContents,\n checkFileExists,\n checkIfExpoBundles,\n createIsolatedTestEnv,\n getWizardCommand,\n} from '../utils';\nimport { afterAll, beforeAll, describe, test, expect } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('Expo', () => {\n let wizardExitCode: number;\n const { projectDir, cleanup } = createIsolatedTestEnv(\n 'react-native-expo-test-app',\n );\n\n beforeAll(async () => {\n wizardExitCode = await withEnv({\n cwd: projectDir,\n })\n .defineInteraction()\n\n .whenAsked('Please select your package manager.')\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Installing @sentry/react-native')\n .expectOutput('Installed @sentry/react-native', {\n timeout: 240_000,\n })\n\n .whenAsked('Do you want to enable Session Replay')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Do you want to enable the Feedback Widget to collect feedback from your users?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('Do you want to enable Logs')\n .respondWith(KEYS.ENTER)\n .expectOutput('Added Sentry.init to app/_layout.tsx')\n .expectOutput('Added Sentry Expo plugin to app.config.json')\n .expectOutput('Added .env.local to .gitignore')\n .expectOutput('Written .env.local')\n .expectOutput('Created metro.config.js with Sentry configuration')\n\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n\n .expectOutput(\n 'To make sure everything is set up correctly, put the following code snippet into your application.',\n )\n .whenAsked('Have you successfully sent a test event?')\n .respondWith(KEYS.ENTER)\n .expectOutput('Everything is set up!')\n\n .run(getWizardCommand(Integration.reactNative));\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 checkFileContents(`${projectDir}/package.json`, `@sentry/react-native`);\n });\n\n test('_layout.tsx is updated correctly', () => {\n checkFileContents(\n `${projectDir}/app/_layout.tsx`,\n `import * as Sentry from '@sentry/react-native';\n\nSentry.init({\n dsn: 'https://public@dsn.ingest.sentry.io/1337',\n\n // Adds more context data to events (IP address, cookies, user, etc.)\n // For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/\n sendDefaultPii: true,\n\n // Enable Logs\n enableLogs: true,\n\n // Configure Session Replay\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1,\n integrations: [Sentry.mobileReplayIntegration(), Sentry.feedbackIntegration()],\n\n // uncomment the line below to enable Spotlight (https://spotlightjs.com)\n // spotlight: __DEV__,\n});`,\n );\n checkFileContents(\n `${projectDir}/app/_layout.tsx`,\n `export default Sentry.wrap(function RootLayout() {`,\n );\n });\n\n test('app.json is updated correctly', () => {\n checkFileContents(\n `${projectDir}/app.json`,\n `\"@sentry/react-native/expo\",\n {\n \"url\": \"https://sentry.io/\",\n \"project\": \"${TEST_ARGS.PROJECT_SLUG}\",\n \"organization\": \"${TEST_ARGS.ORG_SLUG}\"\n }`,\n );\n });\n\n test('metro.config.js is added', () => {\n checkFileExists(`${projectDir}/metro.config.js`);\n checkFileContents(\n `${projectDir}/metro.config.js`,\n `const { getSentryExpoConfig } = require(\"@sentry/react-native/metro\");\n\nconst config = getSentryExpoConfig(__dirname);\n\nmodule.exports = config;`,\n );\n });\n\n test('.gitignore is updated correctly', () => {\n checkFileContents(`${projectDir}/.gitignore`, `.env.local`);\n });\n\n test('android project is bundled correctly', async () => {\n const bundled = await checkIfExpoBundles(projectDir, 'android');\n expect(bundled).toBe(true);\n });\n\n test('ios project is bundled correctly', async () => {\n const bundled = await checkIfExpoBundles(projectDir, 'ios');\n expect(bundled).toBe(true);\n });\n\n test('web project is bundled correctly', async () => {\n const bundled = await checkIfExpoBundles(projectDir, 'web');\n expect(bundled).toBe(true);\n });\n});\n"]}
|
|
@@ -24,117 +24,110 @@ 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
29
|
const utils_2 = require("../utils");
|
|
31
|
-
const utils_3 = require("../utils");
|
|
32
30
|
const vitest_1 = require("vitest");
|
|
31
|
+
//@ts-expect-error - clifty is ESM only
|
|
32
|
+
const clifty_1 = require("clifty");
|
|
33
33
|
(0, vitest_1.describe)('Flutter', () => {
|
|
34
|
-
const integration = Constants_1.Integration.flutter;
|
|
35
|
-
const projectDir = path.resolve(__dirname, '../test-applications/flutter-test-app');
|
|
36
34
|
(0, vitest_1.describe)('with apple platforms', () => {
|
|
35
|
+
let wizardExitCode;
|
|
36
|
+
const { projectDir, cleanup } = (0, utils_1.createIsolatedTestEnv)('flutter-test-app');
|
|
37
37
|
(0, vitest_1.beforeAll)(async () => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
(await wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER], 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?', {
|
|
57
|
-
optional: true,
|
|
58
|
-
}));
|
|
59
|
-
mcpPrompted &&
|
|
60
|
-
(await wizardInstance.sendStdinAndWaitForOutput(
|
|
61
|
-
// Decline MCP config by selecting No
|
|
62
|
-
[utils_1.KEYS.DOWN, utils_1.KEYS.ENTER], 'Successfully installed the Sentry Flutter SDK!'));
|
|
63
|
-
wizardInstance.kill();
|
|
38
|
+
wizardExitCode = await (0, clifty_1.withEnv)({
|
|
39
|
+
cwd: projectDir,
|
|
40
|
+
debug: true,
|
|
41
|
+
})
|
|
42
|
+
.defineInteraction()
|
|
43
|
+
.expectOutput('The Sentry Flutter Wizard will help you set up Sentry for your application')
|
|
44
|
+
.whenAsked('Do you want to enable Tracing')
|
|
45
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
46
|
+
.whenAsked('to analyze CPU usage and optimize performance-critical code on iOS & macOS?')
|
|
47
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
48
|
+
.whenAsked('to record user interactions and debug issues?')
|
|
49
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
50
|
+
.whenAsked('to send your application logs to Sentry?')
|
|
51
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
52
|
+
.whenAsked('Optionally add a project-scoped MCP server configuration for the Sentry MCP?')
|
|
53
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER)
|
|
54
|
+
.expectOutput('Successfully installed the Sentry Flutter SDK!')
|
|
55
|
+
.run((0, utils_1.getWizardCommand)(Constants_1.Integration.flutter));
|
|
64
56
|
});
|
|
65
57
|
(0, vitest_1.afterAll)(() => {
|
|
66
|
-
(
|
|
67
|
-
|
|
58
|
+
cleanup();
|
|
59
|
+
});
|
|
60
|
+
(0, vitest_1.test)('exits with exit code 0', () => {
|
|
61
|
+
(0, vitest_1.expect)(wizardExitCode).toBe(0);
|
|
68
62
|
});
|
|
69
63
|
(0, vitest_1.test)('pubspec.yaml is updated.', () => {
|
|
70
|
-
(0,
|
|
71
|
-
(0,
|
|
72
|
-
(0,
|
|
64
|
+
(0, utils_2.checkFileContents)(`${projectDir}/pubspec.yaml`, `sentry_flutter:`); // dependencies
|
|
65
|
+
(0, utils_2.checkFileContents)(`${projectDir}/pubspec.yaml`, `sentry_dart_plugin:`); // dev_dependencies
|
|
66
|
+
(0, utils_2.checkFileContents)(`${projectDir}/pubspec.yaml`, `sentry:`); // gradle plugin options
|
|
73
67
|
});
|
|
74
68
|
(0, vitest_1.test)('sentry.properties exists and has auth token', () => {
|
|
75
|
-
(0,
|
|
69
|
+
(0, utils_2.checkSentryProperties)(projectDir);
|
|
76
70
|
});
|
|
77
71
|
(0, vitest_1.test)('.gitignore has sentry.properties', () => {
|
|
78
|
-
(0,
|
|
72
|
+
(0, utils_2.checkFileContents)(`${projectDir}/.gitignore`, `sentry.properties`);
|
|
79
73
|
});
|
|
80
74
|
(0, vitest_1.test)('lib/main.dart calls sentry init', () => {
|
|
81
|
-
(0,
|
|
82
|
-
(0,
|
|
75
|
+
(0, utils_2.checkFileContents)(`${projectDir}/lib/main.dart`, `import 'package:sentry_flutter/sentry_flutter.dart';`);
|
|
76
|
+
(0, utils_2.checkFileContents)(`${projectDir}/lib/main.dart`, `await SentryFlutter.init(`);
|
|
83
77
|
});
|
|
84
78
|
(0, vitest_1.test)('lib/main.dart enables tracing and profiling', () => {
|
|
85
|
-
(0,
|
|
86
|
-
(0,
|
|
79
|
+
(0, utils_2.checkFileContents)(`${projectDir}/lib/main.dart`, `options.tracesSampleRate = 1.0;`);
|
|
80
|
+
(0, utils_2.checkFileContents)(`${projectDir}/lib/main.dart`, `options.profilesSampleRate = 1.0;`);
|
|
87
81
|
});
|
|
88
82
|
(0, vitest_1.test)('lib/main.dart enables logs', () => {
|
|
89
|
-
(0,
|
|
83
|
+
(0, utils_2.checkFileContents)(`${projectDir}/lib/main.dart`, `options.enableLogs = true;`);
|
|
90
84
|
});
|
|
91
85
|
(0, vitest_1.test)('builds correctly', async () => {
|
|
92
|
-
await (0,
|
|
86
|
+
await (0, utils_2.checkIfFlutterBuilds)(projectDir, '✓ Built build/web');
|
|
93
87
|
});
|
|
94
88
|
});
|
|
95
89
|
(0, vitest_1.describe)('without apple platforms', () => {
|
|
90
|
+
let wizardExitCode;
|
|
91
|
+
const { projectDir, cleanup } = (0, utils_1.createIsolatedTestEnv)('flutter-test-app');
|
|
96
92
|
(0, vitest_1.beforeAll)(async () => {
|
|
97
|
-
|
|
93
|
+
// Remove apple platform directories to simulate non-apple setup
|
|
98
94
|
if (fs.existsSync(`${projectDir}/ios`)) {
|
|
99
95
|
fs.renameSync(`${projectDir}/ios`, `${projectDir}/_ios`);
|
|
100
96
|
}
|
|
101
97
|
if (fs.existsSync(`${projectDir}/macos`)) {
|
|
102
98
|
fs.renameSync(`${projectDir}/macos`, `${projectDir}/_macos`);
|
|
103
99
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
'
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
'to send your application logs to Sentry?')
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
mcpPrompted &&
|
|
123
|
-
(await wizardInstance.sendStdinAndWaitForOutput(
|
|
124
|
-
// Decline MCP config by selecting No
|
|
125
|
-
[utils_1.KEYS.DOWN, utils_1.KEYS.ENTER], 'Successfully installed the Sentry Flutter SDK!'));
|
|
126
|
-
wizardInstance.kill();
|
|
100
|
+
wizardExitCode = await (0, clifty_1.withEnv)({
|
|
101
|
+
cwd: projectDir,
|
|
102
|
+
debug: true,
|
|
103
|
+
})
|
|
104
|
+
.defineInteraction()
|
|
105
|
+
.whenAsked('Do you want to continue anyway?')
|
|
106
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
107
|
+
.expectOutput('The Sentry Flutter Wizard will help you set up Sentry for your application')
|
|
108
|
+
.whenAsked('Do you want to enable Tracing')
|
|
109
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
110
|
+
.whenAsked('to record user interactions and debug issues?')
|
|
111
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
112
|
+
.whenAsked('to send your application logs to Sentry?')
|
|
113
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
114
|
+
.whenAsked('Optionally add a project-scoped MCP server configuration for the Sentry MCP?')
|
|
115
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER)
|
|
116
|
+
.expectOutput('Successfully installed the Sentry Flutter SDK!')
|
|
117
|
+
.run((0, utils_1.getWizardCommand)(Constants_1.Integration.flutter));
|
|
127
118
|
});
|
|
128
119
|
(0, vitest_1.afterAll)(() => {
|
|
129
|
-
(
|
|
130
|
-
|
|
120
|
+
cleanup();
|
|
121
|
+
});
|
|
122
|
+
(0, vitest_1.test)('exits with exit code 0', () => {
|
|
123
|
+
(0, vitest_1.expect)(wizardExitCode).toBe(0);
|
|
131
124
|
});
|
|
132
125
|
(0, vitest_1.test)('lib/main.dart does not add profiling with missing ios and macos folder', () => {
|
|
133
126
|
const fileContent = fs.readFileSync(`${projectDir}/lib/main.dart`, 'utf-8');
|
|
134
127
|
(0, vitest_1.expect)(fileContent).not.toContain(`options.profilesSampleRate = 1.0;`);
|
|
135
128
|
});
|
|
136
129
|
(0, vitest_1.test)('lib/main.dart enables logs', () => {
|
|
137
|
-
(0,
|
|
130
|
+
(0, utils_2.checkFileContents)(`${projectDir}/lib/main.dart`, `options.enableLogs = true;`);
|
|
138
131
|
});
|
|
139
132
|
});
|
|
140
133
|
});
|