@sentry/wizard 3.42.1 → 4.0.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/.node-cache/node-v22.14.0-darwin-arm64 +0 -0
- package/.node-cache/node-v22.14.0-darwin-x64 +0 -0
- package/.node-cache/node-v22.14.0-linux-arm64 +0 -0
- package/.node-cache/node-v22.14.0-linux-x64 +0 -0
- package/.node-cache/node-v22.14.0-win-x64.exe +0 -0
- package/CHANGELOG.md +26 -0
- package/COPYING +3575 -0
- package/bin.ts +85 -80
- package/dist/bin.js +44 -35
- package/dist/bin.js.map +1 -1
- package/dist/e2e-tests/jest.config.js +1 -1
- package/dist/e2e-tests/jest.config.js.map +1 -1
- package/dist/e2e-tests/tests/flutter.test.js +62 -147
- package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs.test.js +77 -175
- package/dist/e2e-tests/tests/nextjs.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-3.test.js +61 -162
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js +62 -163
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
- package/dist/e2e-tests/tests/remix.test.js +147 -189
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit.test.js +133 -187
- package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
- package/dist/e2e-tests/utils/index.d.ts +1 -1
- package/dist/e2e-tests/utils/index.js +113 -195
- package/dist/e2e-tests/utils/index.js.map +1 -1
- package/dist/lib/Constants.js +5 -5
- package/dist/lib/Constants.js.map +1 -1
- package/dist/lib/Helper/BottomBar.d.ts +1 -1
- package/dist/lib/Helper/BottomBar.js +14 -15
- package/dist/lib/Helper/BottomBar.js.map +1 -1
- package/dist/lib/Helper/Env.js +5 -2
- package/dist/lib/Helper/Env.js.map +1 -1
- package/dist/lib/Helper/File.js +14 -27
- package/dist/lib/Helper/File.js.map +1 -1
- package/dist/lib/Helper/Git.js +24 -59
- package/dist/lib/Helper/Git.js.map +1 -1
- package/dist/lib/Helper/Logging.js +2 -2
- package/dist/lib/Helper/Logging.js.map +1 -1
- package/dist/lib/Helper/MergeConfig.js +4 -4
- package/dist/lib/Helper/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/Package.d.ts +4 -1
- package/dist/lib/Helper/Package.js +12 -38
- package/dist/lib/Helper/Package.js.map +1 -1
- package/dist/lib/Helper/SentryCli.js +77 -149
- package/dist/lib/Helper/SentryCli.js.map +1 -1
- package/dist/lib/Helper/Wizard.js +29 -124
- package/dist/lib/Helper/Wizard.js.map +1 -1
- package/dist/lib/Helper/__tests__/File.js +4 -4
- package/dist/lib/Helper/__tests__/File.js.map +1 -1
- package/dist/lib/Helper/__tests__/MergeConfig.js +24 -24
- package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/__tests__/SentryCli.js +33 -23
- package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
- package/dist/lib/Setup.js +23 -85
- package/dist/lib/Setup.js.map +1 -1
- package/dist/lib/Steps/BaseStep.js +8 -8
- package/dist/lib/Steps/BaseStep.js.map +1 -1
- package/dist/lib/Steps/ChooseIntegration.js +80 -125
- package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
- package/dist/lib/Steps/ConfigureProject.js +6 -66
- package/dist/lib/Steps/ConfigureProject.js.map +1 -1
- package/dist/lib/Steps/Initial.js +16 -104
- package/dist/lib/Steps/Initial.js.map +1 -1
- package/dist/lib/Steps/Integrations/BaseIntegration.js +24 -118
- package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
- package/dist/lib/Steps/Integrations/Cordova.js +95 -183
- package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
- package/dist/lib/Steps/Integrations/Electron.js +87 -145
- package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.js +40 -148
- package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
- package/dist/lib/Steps/OpenSentry.js +63 -126
- package/dist/lib/Steps/OpenSentry.js.map +1 -1
- package/dist/lib/Steps/PromptForParameters.js +110 -206
- package/dist/lib/Steps/PromptForParameters.js.map +1 -1
- package/dist/lib/Steps/Result.js +19 -79
- package/dist/lib/Steps/Result.js.map +1 -1
- package/dist/lib/Steps/SentryProjectSelector.js +57 -148
- package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
- package/dist/lib/Steps/ShouldConfigure.js +6 -66
- package/dist/lib/Steps/ShouldConfigure.js.map +1 -1
- package/dist/lib/Steps/WaitForSentry.js +43 -120
- package/dist/lib/Steps/WaitForSentry.js.map +1 -1
- package/dist/lib/Steps/Welcome.js +17 -76
- package/dist/lib/Steps/Welcome.js.map +1 -1
- package/dist/lib/__tests__/Env.js +3 -3
- package/dist/lib/__tests__/Env.js.map +1 -1
- package/dist/src/android/android-wizard.js +100 -176
- package/dist/src/android/android-wizard.js.map +1 -1
- package/dist/src/android/code-tools.js +24 -33
- package/dist/src/android/code-tools.js.map +1 -1
- package/dist/src/android/gradle.js +106 -165
- package/dist/src/android/gradle.js.map +1 -1
- package/dist/src/android/manifest.js +26 -27
- package/dist/src/android/manifest.js.map +1 -1
- package/dist/src/android/templates.js +76 -23
- package/dist/src/android/templates.js.map +1 -1
- package/dist/src/apple/apple-wizard.js +129 -225
- package/dist/src/apple/apple-wizard.js.map +1 -1
- package/dist/src/apple/cocoapod.js +47 -109
- package/dist/src/apple/cocoapod.js.map +1 -1
- package/dist/src/apple/code-tools.js +32 -35
- package/dist/src/apple/code-tools.js.map +1 -1
- package/dist/src/apple/fastlane.js +51 -97
- package/dist/src/apple/fastlane.js.map +1 -1
- package/dist/src/apple/templates.js +41 -5
- package/dist/src/apple/templates.js.map +1 -1
- package/dist/src/apple/xcode-manager.d.ts +2 -2
- package/dist/src/apple/xcode-manager.js +93 -108
- package/dist/src/apple/xcode-manager.js.map +1 -1
- package/dist/src/flutter/code-tools.js +79 -127
- package/dist/src/flutter/code-tools.js.map +1 -1
- package/dist/src/flutter/flutter-wizard.js +75 -136
- package/dist/src/flutter/flutter-wizard.js.map +1 -1
- package/dist/src/flutter/templates.js +48 -12
- package/dist/src/flutter/templates.js.map +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +527 -805
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nextjs/templates.js +380 -40
- package/dist/src/nextjs/templates.js.map +1 -1
- package/dist/src/nextjs/utils.js +5 -5
- package/dist/src/nextjs/utils.js.map +1 -1
- package/dist/src/nuxt/nuxt-wizard.js +91 -188
- package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
- package/dist/src/nuxt/sdk-example.js +68 -137
- package/dist/src/nuxt/sdk-example.js.map +1 -1
- package/dist/src/nuxt/sdk-setup.d.ts +4 -4
- package/dist/src/nuxt/sdk-setup.js +180 -336
- package/dist/src/nuxt/sdk-setup.js.map +1 -1
- package/dist/src/nuxt/templates.js +195 -18
- package/dist/src/nuxt/templates.js.map +1 -1
- package/dist/src/nuxt/utils.js +29 -76
- package/dist/src/nuxt/utils.js.map +1 -1
- package/dist/src/react-native/expo-env-file.js +41 -94
- package/dist/src/react-native/expo-env-file.js.map +1 -1
- package/dist/src/react-native/expo-metro.d.ts +1 -1
- package/dist/src/react-native/expo-metro.js +75 -130
- package/dist/src/react-native/expo-metro.js.map +1 -1
- package/dist/src/react-native/expo.js +61 -114
- package/dist/src/react-native/expo.js.map +1 -1
- package/dist/src/react-native/git.js +23 -56
- package/dist/src/react-native/git.js.map +1 -1
- package/dist/src/react-native/glob.js +3 -3
- package/dist/src/react-native/glob.js.map +1 -1
- package/dist/src/react-native/gradle.js +4 -4
- package/dist/src/react-native/gradle.js.map +1 -1
- package/dist/src/react-native/javascript.js +51 -95
- package/dist/src/react-native/javascript.js.map +1 -1
- package/dist/src/react-native/metro.js +176 -296
- package/dist/src/react-native/metro.js.map +1 -1
- package/dist/src/react-native/react-native-wizard.js +267 -418
- package/dist/src/react-native/react-native-wizard.js.map +1 -1
- package/dist/src/react-native/uninstall.js +37 -80
- package/dist/src/react-native/uninstall.js.map +1 -1
- package/dist/src/react-native/xcode.js +57 -55
- package/dist/src/react-native/xcode.js.map +1 -1
- package/dist/src/remix/codemods/express-server.js +27 -82
- package/dist/src/remix/codemods/express-server.js.map +1 -1
- package/dist/src/remix/codemods/handle-error.js +28 -31
- package/dist/src/remix/codemods/handle-error.js.map +1 -1
- package/dist/src/remix/codemods/root-common.js +11 -11
- package/dist/src/remix/codemods/root-common.js.map +1 -1
- package/dist/src/remix/codemods/root-v1.js +17 -67
- package/dist/src/remix/codemods/root-v1.js.map +1 -1
- package/dist/src/remix/codemods/root-v2.js +89 -140
- package/dist/src/remix/codemods/root-v2.js.map +1 -1
- package/dist/src/remix/remix-wizard.js +181 -343
- package/dist/src/remix/remix-wizard.js.map +1 -1
- package/dist/src/remix/sdk-example.js +84 -66
- package/dist/src/remix/sdk-example.js.map +1 -1
- package/dist/src/remix/sdk-setup.js +161 -293
- package/dist/src/remix/sdk-setup.js.map +1 -1
- package/dist/src/remix/templates.js +10 -2
- package/dist/src/remix/templates.js.map +1 -1
- package/dist/src/remix/utils.js +13 -14
- package/dist/src/remix/utils.js.map +1 -1
- package/dist/src/run.js +106 -178
- package/dist/src/run.js.map +1 -1
- package/dist/src/sourcemaps/sourcemaps-wizard.js +248 -372
- package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
- package/dist/src/sourcemaps/tools/angular.js +32 -66
- package/dist/src/sourcemaps/tools/angular.js.map +1 -1
- package/dist/src/sourcemaps/tools/create-react-app.js +14 -59
- package/dist/src/sourcemaps/tools/create-react-app.js.map +1 -1
- package/dist/src/sourcemaps/tools/esbuild.js +34 -77
- package/dist/src/sourcemaps/tools/esbuild.js.map +1 -1
- package/dist/src/sourcemaps/tools/nextjs.d.ts +2 -2
- package/dist/src/sourcemaps/tools/nextjs.js +75 -102
- package/dist/src/sourcemaps/tools/nextjs.js.map +1 -1
- package/dist/src/sourcemaps/tools/remix.js +53 -93
- package/dist/src/sourcemaps/tools/remix.js.map +1 -1
- package/dist/src/sourcemaps/tools/rollup.js +35 -76
- package/dist/src/sourcemaps/tools/rollup.js.map +1 -1
- package/dist/src/sourcemaps/tools/sentry-cli.js +157 -289
- package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
- package/dist/src/sourcemaps/tools/tsc.js +68 -134
- package/dist/src/sourcemaps/tools/tsc.js.map +1 -1
- package/dist/src/sourcemaps/tools/vite.js +111 -196
- package/dist/src/sourcemaps/tools/vite.js.map +1 -1
- package/dist/src/sourcemaps/tools/webpack.d.ts +1 -1
- package/dist/src/sourcemaps/tools/webpack.js +158 -260
- package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
- package/dist/src/sourcemaps/utils/detect-tool.js +9 -54
- package/dist/src/sourcemaps/utils/detect-tool.js.map +1 -1
- package/dist/src/sourcemaps/utils/other-wizards.js +77 -144
- package/dist/src/sourcemaps/utils/other-wizards.js.map +1 -1
- package/dist/src/sourcemaps/utils/sdk-version.js +112 -191
- package/dist/src/sourcemaps/utils/sdk-version.js.map +1 -1
- package/dist/src/sveltekit/sdk-example.js +20 -70
- package/dist/src/sveltekit/sdk-example.js.map +1 -1
- package/dist/src/sveltekit/sdk-setup.js +250 -411
- package/dist/src/sveltekit/sdk-setup.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +107 -191
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/src/sveltekit/templates.js +147 -13
- package/dist/src/sveltekit/templates.js.map +1 -1
- package/dist/src/sveltekit/utils.js +3 -3
- package/dist/src/sveltekit/utils.js.map +1 -1
- package/dist/src/telemetry.d.ts +2 -2
- package/dist/src/telemetry.js +58 -108
- package/dist/src/telemetry.js.map +1 -1
- package/dist/src/utils/ast-utils.js +39 -54
- package/dist/src/utils/ast-utils.js.map +1 -1
- package/dist/src/utils/bash.js +28 -75
- package/dist/src/utils/bash.js.map +1 -1
- package/dist/src/utils/clack-utils.d.ts +3 -7
- package/dist/src/utils/clack-utils.js +688 -1083
- package/dist/src/utils/clack-utils.js.map +1 -1
- package/dist/src/utils/debug.js +6 -10
- package/dist/src/utils/debug.js.map +1 -1
- package/dist/src/utils/package-json.js +5 -6
- package/dist/src/utils/package-json.js.map +1 -1
- package/dist/src/utils/package-manager.js +65 -139
- package/dist/src/utils/package-manager.js.map +1 -1
- package/dist/src/utils/release-registry.js +12 -59
- package/dist/src/utils/release-registry.js.map +1 -1
- package/dist/src/utils/semver.js +3 -4
- package/dist/src/utils/semver.js.map +1 -1
- package/dist/src/utils/sentrycli-utils.js +4 -4
- package/dist/src/utils/sentrycli-utils.js.map +1 -1
- package/dist/src/utils/url.js +5 -6
- package/dist/src/utils/url.js.map +1 -1
- package/dist/test/android/code-tools.test.js +18 -18
- package/dist/test/android/code-tools.test.js.map +1 -1
- package/dist/test/apple/cocoapod.test.js +154 -299
- package/dist/test/apple/cocoapod.test.js.map +1 -1
- package/dist/test/apple/code-tools.test.js +375 -263
- package/dist/test/apple/code-tools.test.js.map +1 -1
- package/dist/test/apple/fastfile.test.js +319 -271
- package/dist/test/apple/fastfile.test.js.map +1 -1
- package/dist/test/apple/templates.test.js +114 -30
- package/dist/test/apple/templates.test.js.map +1 -1
- package/dist/test/apple/xcode-manager.test.js +230 -234
- package/dist/test/apple/xcode-manager.test.js.map +1 -1
- package/dist/test/flutter/code-tools.test.js +119 -48
- package/dist/test/flutter/code-tools.test.js.map +1 -1
- package/dist/test/flutter/templates.test.js +63 -20
- package/dist/test/flutter/templates.test.js.map +1 -1
- package/dist/test/nextjs/templates.test.js +332 -43
- package/dist/test/nextjs/templates.test.js.map +1 -1
- package/dist/test/nuxt/templates.test.js +161 -33
- package/dist/test/nuxt/templates.test.js.map +1 -1
- package/dist/test/react-native/expo-metro.test.js +61 -15
- package/dist/test/react-native/expo-metro.test.js.map +1 -1
- package/dist/test/react-native/expo.test.js +37 -17
- package/dist/test/react-native/expo.test.js.map +1 -1
- package/dist/test/react-native/gradle.test.js +260 -28
- package/dist/test/react-native/gradle.test.js.map +1 -1
- package/dist/test/react-native/javascript.test.js +85 -19
- package/dist/test/react-native/javascript.test.js.map +1 -1
- package/dist/test/react-native/metro.test.js +261 -187
- package/dist/test/react-native/metro.test.js.map +1 -1
- package/dist/test/react-native/xcode.test.js +243 -62
- package/dist/test/react-native/xcode.test.js.map +1 -1
- package/dist/test/remix/client-entry.test.js +81 -21
- package/dist/test/remix/client-entry.test.js.map +1 -1
- package/dist/test/remix/server-instrumentation.test.js +21 -8
- package/dist/test/remix/server-instrumentation.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/sentry-cli.test.js +20 -72
- package/dist/test/sourcemaps/tools/sentry-cli.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/tsc.test.js +142 -68
- package/dist/test/sourcemaps/tools/tsc.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/vite.test.js +106 -75
- package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/webpack.test.js +226 -102
- package/dist/test/sourcemaps/tools/webpack.test.js.map +1 -1
- package/dist/test/sveltekit/templates.test.js +117 -18
- package/dist/test/sveltekit/templates.test.js.map +1 -1
- package/dist/test/utils/ast-utils.test.js +99 -58
- package/dist/test/utils/ast-utils.test.js.map +1 -1
- package/dist/test/utils/clack-utils.test.js +142 -247
- package/dist/test/utils/clack-utils.test.js.map +1 -1
- package/e2e-tests/package.json +1 -1
- package/e2e-tests/tests/flutter.test.ts +20 -20
- package/e2e-tests/tests/nextjs.test.ts +2 -2
- package/e2e-tests/tests/nuxt-3.test.ts +4 -4
- package/e2e-tests/tests/nuxt-4.test.ts +3 -3
- package/e2e-tests/tests/remix.test.ts +3 -3
- package/e2e-tests/tests/sveltekit.test.ts +3 -3
- package/e2e-tests/utils/index.ts +33 -15
- package/lib/Helper/BottomBar.ts +1 -1
- package/lib/Helper/Env.ts +1 -1
- package/lib/Helper/Package.ts +12 -10
- package/lib/Helper/SentryCli.ts +18 -27
- package/lib/Helper/Wizard.ts +1 -2
- package/lib/Setup.ts +4 -5
- package/lib/Steps/ChooseIntegration.ts +40 -8
- package/lib/Steps/Initial.ts +17 -26
- package/lib/Steps/Integrations/BaseIntegration.ts +2 -8
- package/lib/Steps/Integrations/Cordova.ts +9 -15
- package/lib/Steps/Integrations/Electron.ts +23 -20
- package/lib/Steps/Integrations/MobileProject.ts +18 -15
- package/lib/Steps/OpenSentry.ts +12 -7
- package/lib/Steps/PromptForParameters.ts +12 -19
- package/lib/Steps/SentryProjectSelector.ts +30 -29
- package/lib/Steps/WaitForSentry.ts +29 -23
- package/package.json +12 -8
- package/src/apple/xcode-manager.ts +10 -10
- package/src/nextjs/templates.ts +2 -3
- package/src/nuxt/sdk-setup.ts +21 -18
- package/src/react-native/expo-metro.ts +2 -2
- package/src/react-native/react-native-wizard.ts +1 -2
- package/src/react-native/uninstall.ts +1 -2
- package/src/react-native/xcode.ts +1 -1
- package/src/run.ts +12 -5
- package/src/sourcemaps/tools/nextjs.ts +2 -2
- package/src/sourcemaps/tools/webpack.ts +3 -3
- package/src/telemetry.ts +27 -7
- package/src/utils/clack-utils.ts +50 -47
- package/test/apple/cocoapod.test.ts +4 -0
- package/test/apple/fastfile.test.ts +12 -7
- package/test/apple/xcode-manager.test.ts +13 -11
- package/test/utils/clack-utils.test.ts +40 -50
- package/types/read-env.d.ts +3 -0
- package/types/xcode.d.ts +1 -0
- package/dist/package.json +0 -128
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastfile.test.js","sourceRoot":"","sources":["../../../test/apple/fastfile.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAyB;AACzB,qCAAyB;AACzB,yCAA6B;AAC7B,qDAIkC;AAClC,yEAAyE;AACzE,oDAAwC;AAExC,Q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AC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,SAAS,iBAAiB;IACxB,IAAM,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;IAC3E,IAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACvD,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE;QACxB,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;IACH,OAAO,EAAE,WAAW,aAAA,EAAE,WAAW,aAAA,EAAE,CAAC;AACtC,CAAC;AAED,SAAS,cAAc,CAAC,WAAmB,EAAE,OAAe;IAC1D,IAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import * as fs from 'fs';\nimport * as os from 'os';\nimport * as path from 'path';\nimport {\n addSentryToFastlane,\n exportForTesting,\n fastFile,\n} from '../../src/apple/fastlane';\n// @ts-ignore - clack is ESM and TS complains about that. It works though\nimport * as clack from '@clack/prompts';\n\ndescribe('fastlane', () => {\n beforeEach(() => {\n jest.spyOn(clack.log, 'warn').mockImplementation();\n jest.spyOn(clack, 'select').mockResolvedValue(undefined);\n });\n\n describe('#fastFile', () => {\n describe('file exists', () => {\n it('should return path', () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n const fastfile = createFastfile(fastlaneDir, 'lane :test do');\n\n // -- Act --\n const result = fastFile(projectPath);\n\n // -- Assert --\n expect(result).toBe(fastfile);\n });\n });\n\n describe('file does not exist', () => {\n it('should return null', () => {\n // -- Arrange --\n const { projectPath } = createFastlaneDir();\n // do not create Fastfile\n\n // -- Act --\n const result = fastFile(projectPath);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n });\n\n describe('#findIOSPlatform', () => {\n describe('platform block detection', () => {\n const variations: {\n name: string;\n content: string;\n expected: { index: number; length: number };\n }[] = [\n {\n name: 'no platform',\n content: `lane :test do\nend`,\n expected: { index: 0, length: 17 },\n },\n {\n name: 'platform is ios',\n content: `platform: ios\nlane :test do\nend`,\n expected: { index: 0, length: 31 },\n },\n {\n name: 'platform is ios and other platform',\n content: `platform: ios\nend\nplatform: android\n lane :test do\n end`,\n expected: { index: 0, length: 57 },\n },\n {\n name: 'platform is ios and other platform',\n content: `\n\\t\\tplatform: ios\n\\t\\tend\n\\t\\tplatform: android\n\\t\\t\\tlane :test do\n\\t\\t\\tend`,\n expected: { index: 0, length: 66 },\n },\n ];\n\n for (const variation of variations) {\n describe(`${variation.name}`, () => {\n it('should return null', () => {\n // -- Act --\n const result = exportForTesting.findIOSPlatform(variation.content);\n\n // -- Assert --\n expect(result).toEqual(variation.expected);\n });\n });\n }\n });\n\n describe('platform block not found', () => {\n it('should return full content', () => {\n // -- Arrange --\n const content = `\n lane :test do\n puts 'Hello, world!'\n end`;\n\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toEqual({ index: 0, length: 65 });\n });\n });\n\n describe('invalid platform block', () => {\n it('should return null', () => {\n // -- Arrange --\n // platform block is not opened with `do`\n const content = `\nplatform :ios\\n\n lane :test do\n puts 'Hello, world!'\n end\nend\n`;\n\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n\n describe('platform block is not closed', () => {\n it('should return null', () => {\n // -- Arrange --\n const content = `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n end\n`;\n\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n\n describe('multiple platforms detected', () => {\n it('should return block with ios platform', () => {\n // -- Arrange --\n const content = `\nfastlane_version '2.53.1'\n\nbefore_all do\n ensure_git_branch\n ensure_git_status_clean\n git_pull\nend\n\nplatform :ios do\n # iOS Lanes\nend\n\nplatform :android do\n # Android Lanes\nend\n`;\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toEqual({ index: 121, length: 15 });\n });\n });\n });\n\n describe('#findLanes', () => {\n describe('lanes detection', () => {\n describe('valid cases', () => {\n const variations: {\n name: string;\n content: string;\n expected: { index: number; length: number; name: string }[] | null;\n }[] = [\n {\n name: 'single lane',\n content: `\n lane :test do\n puts 'Hello, world!'\n end\n`,\n expected: [{ index: 17, length: 25, name: 'test' }],\n },\n {\n name: 'multiple lanes',\n content: `\n lane :test do\n puts 'Hello, world!'\n end\n lane :test2 do\n puts 'Hello, world!'\n end`,\n expected: [\n { index: 17, length: 25, name: 'test' },\n { index: 65, length: 25, name: 'test2' },\n ],\n },\n ];\n\n for (const variation of variations) {\n describe(`${variation.name}`, () => {\n it('should return lanes', () => {\n // -- Act --\n const result = exportForTesting.findLanes(variation.content);\n\n // -- Assert --\n expect(result).toEqual(variation.expected);\n });\n });\n }\n });\n\n describe('invalid cases', () => {\n describe('lane is not indented', () => {\n it('should return null', () => {\n // -- Arrange --\n const content = `lane :test do\\nend`;\n\n // -- Act --\n const result = exportForTesting.findLanes(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n\n describe('lane is not closed', () => {\n it('should return null', () => {\n // -- Arrange --\n const content = ` lane :test do\\n`;\n\n // -- Act --\n const result = exportForTesting.findLanes(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n });\n });\n });\n\n describe('#addSentryToLane', () => {\n describe('sentry_cli is not present', () => {\n it('should return original content', () => {\n // -- Arrange --\n const content = `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n end\nend\n`;\n const lane = { index: 34, length: 25, name: 'test' };\n\n // -- Act --\n const result = exportForTesting.addSentryToLane(\n content,\n lane,\n 'test-org',\n 'test-project',\n );\n\n // -- Assert --\n expect(result).toBe(`\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`);\n });\n });\n\n describe('sentry_cli is present', () => {\n it('should return updated content', () => {\n // -- Arrange --\n const content = `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_cli(org_slug: 'test-org', project_slug: 'test-project')\n end\nend\n`;\n const lane = { index: 34, length: 92, name: 'test' };\n\n // -- Act --\n const result = exportForTesting.addSentryToLane(\n content,\n lane,\n 'test-org',\n 'test-project',\n );\n\n // -- Assert --\n expect(result).toBe(\n `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`,\n );\n });\n });\n });\n\n describe('#addSentryToFastlane', () => {\n const org = 'test-org';\n const project = 'test-project';\n\n describe('Fastfile not found', () => {\n it('should return false', async () => {\n // -- Arrange --\n const { projectPath } = createFastlaneDir();\n const fastfilePath = path.join(projectPath, 'Fastfile');\n // do not create Fastfile\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(fs.existsSync(fastfilePath)).toBe(false);\n });\n });\n\n describe('platform not found', () => {\n it('should return false', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n const fastfilePath = createFastfile(\n fastlaneDir,\n `\nplatform :ios\n lane :test do\n puts 'Hello, world!'\n end\nend\n`,\n );\n const originalContent = fs.readFileSync(fastfilePath, 'utf8');\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(originalContent);\n });\n });\n\n describe('no lanes', () => {\n it('should return false', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n createFastfile(fastlaneDir, `platform :ios`);\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n });\n\n it('should warn user', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n createFastfile(fastlaneDir, `platform :ios`);\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(clack.log.warn).toHaveBeenCalledWith(\n 'No suitable lanes in your Fastfile.',\n );\n });\n });\n\n describe('single lane', () => {\n it('should return true', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n const fastfilePath = createFastfile(\n fastlaneDir,\n `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n end \nend\n`,\n );\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(true);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(\n `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end \nend\n`,\n );\n });\n });\n\n describe('multiple lanes', () => {\n let fastfilePath: string;\n let projectPath: string;\n let originalContent: string;\n\n beforeEach(() => {\n const createdFastlaneDir = createFastlaneDir();\n projectPath = createdFastlaneDir.projectPath;\n fastfilePath = createFastfile(\n createdFastlaneDir.fastlaneDir,\n `platform :ios do\n lane :test do\n puts 'Hello, world!'\n end \n\n lane :beta do\n puts 'Beta lane'\n end\nend\n`,\n );\n });\n\n describe('no lane selected', () => {\n it('should not modify Fastfile', async () => {\n // -- Arrange --\n originalContent = fs.readFileSync(fastfilePath, 'utf8');\n jest.spyOn(clack, 'select').mockResolvedValue(undefined);\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(originalContent);\n });\n });\n\n describe('lane selected', () => {\n it('should modify only selected lane', async () => {\n // -- Arrange --\n jest.spyOn(clack, 'select').mockResolvedValue({\n value: 'beta',\n index: 1,\n });\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(true);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(\n `platform :ios do\n lane :test do\n puts 'Hello, world!'\n end \n\n lane :beta do\n puts 'Beta lane'\n\n sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`,\n );\n expect(clack.select).toHaveBeenCalledWith({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n maxItems: expect.any(Number),\n message: 'Select lane to add Sentry to:',\n options: [\n { value: { value: 'test', index: 0 }, label: 'test' },\n { value: { value: 'beta', index: 1 }, label: 'beta' },\n ],\n });\n });\n });\n });\n });\n});\n\nfunction createFastlaneDir() {\n const projectPath = fs.mkdtempSync(path.join(os.tmpdir(), 'test-project'));\n const fastlaneDir = path.join(projectPath, 'fastlane');\n fs.mkdirSync(fastlaneDir, {\n recursive: true,\n });\n return { fastlaneDir, projectPath };\n}\n\nfunction createFastfile(fastlaneDir: string, content: string) {\n const fastfile = path.join(fastlaneDir, 'Fastfile');\n fs.writeFileSync(fastfile, content);\n return fastfile;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"fastfile.test.js","sourceRoot":"","sources":["../../../test/apple/fastfile.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,4CAA8B;AAC9B,gDAAkC;AAClC,uDAIkC;AAClC,yEAAyE;AACzE,sDAAwC;AAExC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC;IACjC,UAAU,EAAE,IAAI;IAChB,GAAG,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC;CACxC,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,UAA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AAI,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport {\n addSentryToFastlane,\n exportForTesting,\n fastFile,\n} from '../../src/apple/fastlane';\n// @ts-ignore - clack is ESM and TS complains about that. It works though\nimport * as clack from '@clack/prompts';\n\njest.mock('@clack/prompts', () => ({\n __esModule: true,\n ...jest.requireActual('@clack/prompts'),\n}));\n\ndescribe('fastlane', () => {\n beforeEach(() => {\n jest.spyOn(clack.log, 'warn').mockImplementation();\n jest.spyOn(clack, 'select').mockResolvedValue(undefined);\n });\n\n describe('#fastFile', () => {\n describe('file exists', () => {\n it('should return path', () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n const fastfile = createFastfile(fastlaneDir, 'lane :test do');\n\n // -- Act --\n const result = fastFile(projectPath);\n\n // -- Assert --\n expect(result).toBe(fastfile);\n });\n });\n\n describe('file does not exist', () => {\n it('should return null', () => {\n // -- Arrange --\n const { projectPath } = createFastlaneDir();\n // do not create Fastfile\n\n // -- Act --\n const result = fastFile(projectPath);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n });\n\n describe('#findIOSPlatform', () => {\n describe('platform block detection', () => {\n const variations: {\n name: string;\n content: string;\n expected: { index: number; length: number };\n }[] = [\n {\n name: 'no platform',\n content: `lane :test do\nend`,\n expected: { index: 0, length: 17 },\n },\n {\n name: 'platform is ios',\n content: `platform: ios\nlane :test do\nend`,\n expected: { index: 0, length: 31 },\n },\n {\n name: 'platform is ios and other platform',\n content: `platform: ios\nend\nplatform: android\n lane :test do\n end`,\n expected: { index: 0, length: 57 },\n },\n {\n name: 'platform is ios and other platform',\n content: `\n\\t\\tplatform: ios\n\\t\\tend\n\\t\\tplatform: android\n\\t\\t\\tlane :test do\n\\t\\t\\tend`,\n expected: { index: 0, length: 66 },\n },\n ];\n\n for (const variation of variations) {\n describe(`${variation.name}`, () => {\n it('should return null', () => {\n // -- Act --\n const result = exportForTesting.findIOSPlatform(variation.content);\n\n // -- Assert --\n expect(result).toEqual(variation.expected);\n });\n });\n }\n });\n\n describe('platform block not found', () => {\n it('should return full content', () => {\n // -- Arrange --\n const content = `\n lane :test do\n puts 'Hello, world!'\n end`;\n\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toEqual({ index: 0, length: 65 });\n });\n });\n\n describe('invalid platform block', () => {\n it('should return null', () => {\n // -- Arrange --\n // platform block is not opened with `do`\n const content = `\nplatform :ios\\n\n lane :test do\n puts 'Hello, world!'\n end\nend\n`;\n\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n\n describe('platform block is not closed', () => {\n it('should return null', () => {\n // -- Arrange --\n const content = `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n end\n`;\n\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n\n describe('multiple platforms detected', () => {\n it('should return block with ios platform', () => {\n // -- Arrange --\n const content = `\nfastlane_version '2.53.1'\n\nbefore_all do\n ensure_git_branch\n ensure_git_status_clean\n git_pull\nend\n\nplatform :ios do\n # iOS Lanes\nend\n\nplatform :android do\n # Android Lanes\nend\n`;\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toEqual({ index: 121, length: 15 });\n });\n });\n });\n\n describe('#findLanes', () => {\n describe('lanes detection', () => {\n describe('valid cases', () => {\n const variations: {\n name: string;\n content: string;\n expected: { index: number; length: number; name: string }[] | null;\n }[] = [\n {\n name: 'single lane',\n content: `\n lane :test do\n puts 'Hello, world!'\n end\n`,\n expected: [{ index: 17, length: 25, name: 'test' }],\n },\n {\n name: 'multiple lanes',\n content: `\n lane :test do\n puts 'Hello, world!'\n end\n lane :test2 do\n puts 'Hello, world!'\n end`,\n expected: [\n { index: 17, length: 25, name: 'test' },\n { index: 65, length: 25, name: 'test2' },\n ],\n },\n ];\n\n for (const variation of variations) {\n describe(`${variation.name}`, () => {\n it('should return lanes', () => {\n // -- Act --\n const result = exportForTesting.findLanes(variation.content);\n\n // -- Assert --\n expect(result).toEqual(variation.expected);\n });\n });\n }\n });\n\n describe('invalid cases', () => {\n describe('lane is not indented', () => {\n it('should return null', () => {\n // -- Arrange --\n const content = `lane :test do\\nend`;\n\n // -- Act --\n const result = exportForTesting.findLanes(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n\n describe('lane is not closed', () => {\n it('should return null', () => {\n // -- Arrange --\n const content = ` lane :test do\\n`;\n\n // -- Act --\n const result = exportForTesting.findLanes(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n });\n });\n });\n\n describe('#addSentryToLane', () => {\n describe('sentry_cli is not present', () => {\n it('should return original content', () => {\n // -- Arrange --\n const content = `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n end\nend\n`;\n const lane = { index: 34, length: 25, name: 'test' };\n\n // -- Act --\n const result = exportForTesting.addSentryToLane(\n content,\n lane,\n 'test-org',\n 'test-project',\n );\n\n // -- Assert --\n expect(result).toBe(`\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`);\n });\n });\n\n describe('sentry_cli is present', () => {\n it('should return updated content', () => {\n // -- Arrange --\n const content = `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_cli(org_slug: 'test-org', project_slug: 'test-project')\n end\nend\n`;\n const lane = { index: 34, length: 92, name: 'test' };\n\n // -- Act --\n const result = exportForTesting.addSentryToLane(\n content,\n lane,\n 'test-org',\n 'test-project',\n );\n\n // -- Assert --\n expect(result).toBe(\n `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`,\n );\n });\n });\n });\n\n describe('#addSentryToFastlane', () => {\n const org = 'test-org';\n const project = 'test-project';\n\n describe('Fastfile not found', () => {\n it('should return false', async () => {\n // -- Arrange --\n const { projectPath } = createFastlaneDir();\n const fastfilePath = path.join(projectPath, 'Fastfile');\n // do not create Fastfile\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(fs.existsSync(fastfilePath)).toBe(false);\n });\n });\n\n describe('platform not found', () => {\n it('should return false', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n const fastfilePath = createFastfile(\n fastlaneDir,\n `\nplatform :ios\n lane :test do\n puts 'Hello, world!'\n end\nend\n`,\n );\n const originalContent = fs.readFileSync(fastfilePath, 'utf8');\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(originalContent);\n });\n });\n\n describe('no lanes', () => {\n it('should return false', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n createFastfile(fastlaneDir, `platform :ios`);\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n });\n\n it('should warn user', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n createFastfile(fastlaneDir, `platform :ios`);\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(clack.log.warn).toHaveBeenCalledWith(\n 'No suitable lanes in your Fastfile.',\n );\n });\n });\n\n describe('single lane', () => {\n it('should return true', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n const fastfilePath = createFastfile(\n fastlaneDir,\n `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n end\nend\n`,\n );\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(true);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(\n `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`,\n );\n });\n });\n\n describe('multiple lanes', () => {\n let fastfilePath: string;\n let projectPath: string;\n let originalContent: string;\n\n beforeEach(() => {\n const createdFastlaneDir = createFastlaneDir();\n projectPath = createdFastlaneDir.projectPath;\n fastfilePath = createFastfile(\n createdFastlaneDir.fastlaneDir,\n `platform :ios do\n lane :test do\n puts 'Hello, world!'\n end\n\n lane :beta do\n puts 'Beta lane'\n end\nend\n`,\n );\n });\n\n describe('no lane selected', () => {\n it('should not modify Fastfile', async () => {\n // -- Arrange --\n originalContent = fs.readFileSync(fastfilePath, 'utf8');\n jest.spyOn(clack, 'select').mockResolvedValue(undefined);\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(originalContent);\n });\n });\n\n describe('lane selected', () => {\n it('should modify only selected lane', async () => {\n // -- Arrange --\n jest.spyOn(clack, 'select').mockResolvedValue({\n value: 'beta',\n index: 1,\n });\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(true);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(\n `platform :ios do\n lane :test do\n puts 'Hello, world!'\n end\n\n lane :beta do\n puts 'Beta lane'\n\n sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`,\n );\n expect(clack.select).toHaveBeenCalledWith({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n maxItems: expect.any(Number),\n message: 'Select lane to add Sentry to:',\n options: [\n { value: { value: 'test', index: 0 }, label: 'test' },\n { value: { value: 'beta', index: 1 }, label: 'beta' },\n ],\n });\n });\n });\n });\n });\n});\n\nfunction createFastlaneDir() {\n const projectPath = fs.mkdtempSync(path.join(os.tmpdir(), 'test-project'));\n const fastlaneDir = path.join(projectPath, 'fastlane');\n fs.mkdirSync(fastlaneDir, {\n recursive: true,\n });\n return { fastlaneDir, projectPath };\n}\n\nfunction createFastfile(fastlaneDir: string, content: string) {\n const fastfile = path.join(fastlaneDir, 'Fastfile');\n fs.writeFileSync(fastfile, content);\n return fastfile;\n}\n"]}
|
|
@@ -1,72 +1,156 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
describe('templates',
|
|
5
|
-
describe('getRunScriptTemplate',
|
|
6
|
-
|
|
3
|
+
const templates_1 = require("../../src/apple/templates");
|
|
4
|
+
describe('templates', () => {
|
|
5
|
+
describe('getRunScriptTemplate', () => {
|
|
6
|
+
const variations = [
|
|
7
7
|
{
|
|
8
8
|
uploadSource: true,
|
|
9
9
|
includeHomebrewPath: true,
|
|
10
|
-
expectedScript:
|
|
10
|
+
expectedScript: `# This script is responsable to upload debug symbols and source context for Sentry.
|
|
11
|
+
if [[ "$(uname -m)" == arm64 ]]; then
|
|
12
|
+
export PATH="/opt/homebrew/bin:$PATH"
|
|
13
|
+
fi
|
|
14
|
+
if which sentry-cli >/dev/null; then
|
|
15
|
+
export SENTRY_ORG=test-org
|
|
16
|
+
export SENTRY_PROJECT=test-project
|
|
17
|
+
ERROR=$(sentry-cli debug-files upload --include-sources "$DWARF_DSYM_FOLDER_PATH" 2>&1 >/dev/null)
|
|
18
|
+
if [ ! $? -eq 0 ]; then
|
|
19
|
+
echo "warning: sentry-cli - $ERROR"
|
|
20
|
+
fi
|
|
21
|
+
else
|
|
22
|
+
echo "warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases"
|
|
23
|
+
fi
|
|
24
|
+
`.replace(/\n/g, '\\n'),
|
|
11
25
|
},
|
|
12
26
|
{
|
|
13
27
|
uploadSource: true,
|
|
14
28
|
includeHomebrewPath: false,
|
|
15
|
-
expectedScript:
|
|
29
|
+
expectedScript: `# This script is responsable to upload debug symbols and source context for Sentry.
|
|
30
|
+
if which sentry-cli >/dev/null; then
|
|
31
|
+
export SENTRY_ORG=test-org
|
|
32
|
+
export SENTRY_PROJECT=test-project
|
|
33
|
+
ERROR=$(sentry-cli debug-files upload --include-sources "$DWARF_DSYM_FOLDER_PATH" 2>&1 >/dev/null)
|
|
34
|
+
if [ ! $? -eq 0 ]; then
|
|
35
|
+
echo "warning: sentry-cli - $ERROR"
|
|
36
|
+
fi
|
|
37
|
+
else
|
|
38
|
+
echo "warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases"
|
|
39
|
+
fi
|
|
40
|
+
`.replace(/\n/g, '\\n'),
|
|
16
41
|
},
|
|
17
42
|
{
|
|
18
43
|
uploadSource: false,
|
|
19
44
|
includeHomebrewPath: true,
|
|
20
|
-
expectedScript:
|
|
45
|
+
expectedScript: `# This script is responsable to upload debug symbols and source context for Sentry.
|
|
46
|
+
if [[ "$(uname -m)" == arm64 ]]; then
|
|
47
|
+
export PATH="/opt/homebrew/bin:$PATH"
|
|
48
|
+
fi
|
|
49
|
+
if which sentry-cli >/dev/null; then
|
|
50
|
+
export SENTRY_ORG=test-org
|
|
51
|
+
export SENTRY_PROJECT=test-project
|
|
52
|
+
ERROR=$(sentry-cli debug-files upload "$DWARF_DSYM_FOLDER_PATH" 2>&1 >/dev/null)
|
|
53
|
+
if [ ! $? -eq 0 ]; then
|
|
54
|
+
echo "warning: sentry-cli - $ERROR"
|
|
55
|
+
fi
|
|
56
|
+
else
|
|
57
|
+
echo "warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases"
|
|
58
|
+
fi
|
|
59
|
+
`.replace(/\n/g, '\\n'),
|
|
21
60
|
},
|
|
22
61
|
{
|
|
23
62
|
uploadSource: false,
|
|
24
63
|
includeHomebrewPath: false,
|
|
25
|
-
expectedScript:
|
|
64
|
+
expectedScript: `# This script is responsable to upload debug symbols and source context for Sentry.
|
|
65
|
+
if which sentry-cli >/dev/null; then
|
|
66
|
+
export SENTRY_ORG=test-org
|
|
67
|
+
export SENTRY_PROJECT=test-project
|
|
68
|
+
ERROR=$(sentry-cli debug-files upload "$DWARF_DSYM_FOLDER_PATH" 2>&1 >/dev/null)
|
|
69
|
+
if [ ! $? -eq 0 ]; then
|
|
70
|
+
echo "warning: sentry-cli - $ERROR"
|
|
71
|
+
fi
|
|
72
|
+
else
|
|
73
|
+
echo "warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases"
|
|
74
|
+
fi
|
|
75
|
+
`.replace(/\n/g, '\\n'),
|
|
26
76
|
},
|
|
27
77
|
];
|
|
28
|
-
|
|
29
|
-
describe(
|
|
30
|
-
it('should return the correct script',
|
|
78
|
+
for (const variation of variations) {
|
|
79
|
+
describe(`uploadSource: ${variation.uploadSource.toString()} and includeHomebrewPath: ${variation.includeHomebrewPath.toString()}`, () => {
|
|
80
|
+
it('should return the correct script', () => {
|
|
31
81
|
// -- ct --
|
|
32
|
-
|
|
82
|
+
const script = (0, templates_1.getRunScriptTemplate)('test-org', 'test-project', variation.uploadSource, variation.includeHomebrewPath);
|
|
33
83
|
// -- Assert --
|
|
34
84
|
expect(script).toBe(variation.expectedScript);
|
|
35
85
|
});
|
|
36
86
|
});
|
|
37
|
-
};
|
|
38
|
-
for (var _i = 0, variations_1 = variations; _i < variations_1.length; _i++) {
|
|
39
|
-
var variation = variations_1[_i];
|
|
40
|
-
_loop_1(variation);
|
|
41
87
|
}
|
|
42
88
|
});
|
|
43
|
-
describe('scriptInputPath',
|
|
44
|
-
it('should return the correct path',
|
|
89
|
+
describe('scriptInputPath', () => {
|
|
90
|
+
it('should return the correct path', () => {
|
|
45
91
|
expect(templates_1.scriptInputPath).toBe('"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}"');
|
|
46
92
|
});
|
|
47
93
|
});
|
|
48
|
-
describe('getSwiftSnippet',
|
|
49
|
-
it('should return the correct snippet',
|
|
94
|
+
describe('getSwiftSnippet', () => {
|
|
95
|
+
it('should return the correct snippet', () => {
|
|
50
96
|
// -- Arrange --
|
|
51
|
-
|
|
97
|
+
const snippet = (0, templates_1.getSwiftSnippet)('test-dsn');
|
|
52
98
|
// -- Assert --
|
|
53
|
-
expect(snippet).toBe(
|
|
99
|
+
expect(snippet).toBe(` SentrySDK.start { options in
|
|
100
|
+
options.dsn = "test-dsn"
|
|
101
|
+
options.debug = true // Enabled debug when first installing is always helpful
|
|
102
|
+
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
|
|
103
|
+
// We recommend adjusting this value in production.
|
|
104
|
+
options.tracesSampleRate = 1.0
|
|
105
|
+
|
|
106
|
+
// Sample rate for profiling, applied on top of TracesSampleRate.
|
|
107
|
+
// We recommend adjusting this value in production.
|
|
108
|
+
options.profilesSampleRate = 1.0
|
|
109
|
+
|
|
110
|
+
// Uncomment the following lines to add more data to your events
|
|
111
|
+
// options.attachScreenshot = true // This adds a screenshot to the error events
|
|
112
|
+
// options.attachViewHierarchy = true // This adds the view hierarchy to the error events
|
|
113
|
+
}
|
|
114
|
+
// Remove the next line after confirming that your Sentry integration is working.
|
|
115
|
+
SentrySDK.capture(message: "This app uses Sentry! :)")
|
|
116
|
+
`);
|
|
54
117
|
});
|
|
55
118
|
});
|
|
56
|
-
describe('getObjcSnippet',
|
|
57
|
-
it('should return the correct snippet',
|
|
119
|
+
describe('getObjcSnippet', () => {
|
|
120
|
+
it('should return the correct snippet', () => {
|
|
58
121
|
// -- Arrange --
|
|
59
|
-
|
|
122
|
+
const snippet = (0, templates_1.getObjcSnippet)('test-dsn');
|
|
60
123
|
// -- Assert --
|
|
61
|
-
expect(snippet).toBe(
|
|
124
|
+
expect(snippet).toBe(` [SentrySDK startWithConfigureOptions:^(SentryOptions * options) {
|
|
125
|
+
options.dsn = @"test-dsn";
|
|
126
|
+
options.debug = YES; // Enabled debug when first installing is always helpful
|
|
127
|
+
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
|
|
128
|
+
// We recommend adjusting this value in production.
|
|
129
|
+
options.tracesSampleRate = @1.0;
|
|
130
|
+
|
|
131
|
+
// Sample rate for profiling, applied on top of TracesSampleRate.
|
|
132
|
+
// We recommend adjusting this value in production.
|
|
133
|
+
options.profilesSampleRate = @1.0;
|
|
134
|
+
|
|
135
|
+
//Uncomment the following lines to add more data to your events
|
|
136
|
+
//options.attachScreenshot = YES; //This will add a screenshot to the error events
|
|
137
|
+
//options.attachViewHierarchy = YES; //This will add the view hierarchy to the error events
|
|
138
|
+
}];
|
|
139
|
+
//Remove the next line after confirming that your Sentry integration is working.
|
|
140
|
+
[SentrySDK captureMessage:@"This app uses Sentry!"];
|
|
141
|
+
`);
|
|
62
142
|
});
|
|
63
143
|
});
|
|
64
|
-
describe('getFastlaneSnippet',
|
|
65
|
-
it('should return the correct snippet',
|
|
144
|
+
describe('getFastlaneSnippet', () => {
|
|
145
|
+
it('should return the correct snippet', () => {
|
|
66
146
|
// -- Arrange --
|
|
67
|
-
|
|
147
|
+
const snippet = (0, templates_1.getFastlaneSnippet)('test-org', 'test-project');
|
|
68
148
|
// -- Assert --
|
|
69
|
-
expect(snippet).toBe(
|
|
149
|
+
expect(snippet).toBe(` sentry_cli(
|
|
150
|
+
org_slug: 'test-org',
|
|
151
|
+
project_slug: 'test-project',
|
|
152
|
+
include_sources: true
|
|
153
|
+
)`);
|
|
70
154
|
});
|
|
71
155
|
});
|
|
72
156
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/apple/templates.test.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/apple/templates.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et,\n getObjcSnippet,\n getRunScriptTemplate,\n getSwiftSnippet,\n scriptInputPath,\n} from '../../src/apple/templates';\n\ndescribe('templates', () => {\n describe('getRunScriptTemplate', () => {\n const variations: {\n uploadSource: boolean;\n includeHomebrewPath: boolean;\n expectedScript: string;\n }[] = [\n {\n uploadSource: true,\n includeHomebrewPath: true,\n expectedScript:\n `# This script is responsable to upload debug symbols and source context for Sentry.\nif [[ \"$(uname -m)\" == arm64 ]]; then\nexport PATH=\"/opt/homebrew/bin:$PATH\"\nfi\nif which sentry-cli >/dev/null; then\nexport SENTRY_ORG=test-org\nexport SENTRY_PROJECT=test-project\nERROR=$(sentry-cli debug-files upload --include-sources \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\nif [ ! $? -eq 0 ]; then\necho \"warning: sentry-cli - $ERROR\"\nfi\nelse\necho \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`.replace(/\\n/g, '\\\\n'),\n },\n {\n uploadSource: true,\n includeHomebrewPath: false,\n expectedScript:\n `# This script is responsable to upload debug symbols and source context for Sentry.\nif which sentry-cli >/dev/null; then\nexport SENTRY_ORG=test-org\nexport SENTRY_PROJECT=test-project\nERROR=$(sentry-cli debug-files upload --include-sources \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\nif [ ! $? -eq 0 ]; then\necho \"warning: sentry-cli - $ERROR\"\nfi\nelse\necho \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`.replace(/\\n/g, '\\\\n'),\n },\n {\n uploadSource: false,\n includeHomebrewPath: true,\n expectedScript:\n `# This script is responsable to upload debug symbols and source context for Sentry.\nif [[ \"$(uname -m)\" == arm64 ]]; then\nexport PATH=\"/opt/homebrew/bin:$PATH\"\nfi\nif which sentry-cli >/dev/null; then\nexport SENTRY_ORG=test-org\nexport SENTRY_PROJECT=test-project\nERROR=$(sentry-cli debug-files upload \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\nif [ ! $? -eq 0 ]; then\necho \"warning: sentry-cli - $ERROR\"\nfi\nelse\necho \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`.replace(/\\n/g, '\\\\n'),\n },\n {\n uploadSource: false,\n includeHomebrewPath: false,\n expectedScript:\n `# This script is responsable to upload debug symbols and source context for Sentry.\nif which sentry-cli >/dev/null; then\nexport SENTRY_ORG=test-org\nexport SENTRY_PROJECT=test-project\nERROR=$(sentry-cli debug-files upload \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\nif [ ! $? -eq 0 ]; then\necho \"warning: sentry-cli - $ERROR\"\nfi\nelse\necho \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`.replace(/\\n/g, '\\\\n'),\n },\n ];\n\n for (const variation of variations) {\n describe(`uploadSource: ${variation.uploadSource.toString()} and includeHomebrewPath: ${variation.includeHomebrewPath.toString()}`, () => {\n it('should return the correct script', () => {\n // -- ct --\n const script = getRunScriptTemplate(\n 'test-org',\n 'test-project',\n variation.uploadSource,\n variation.includeHomebrewPath,\n );\n\n // -- Assert --\n expect(script).toBe(variation.expectedScript);\n });\n });\n }\n });\n\n describe('scriptInputPath', () => {\n it('should return the correct path', () => {\n expect(scriptInputPath).toBe(\n '\"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}\"',\n );\n });\n });\n\n describe('getSwiftSnippet', () => {\n it('should return the correct snippet', () => {\n // -- Arrange --\n const snippet = getSwiftSnippet('test-dsn');\n\n // -- Assert --\n expect(snippet).toBe(\n ` SentrySDK.start { options in\n options.dsn = \"test-dsn\"\n options.debug = true // Enabled debug when first installing is always helpful\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0\n\n // Sample rate for profiling, applied on top of TracesSampleRate.\n // We recommend adjusting this value in production.\n options.profilesSampleRate = 1.0 \n\n // Uncomment the following lines to add more data to your events\n // options.attachScreenshot = true // This adds a screenshot to the error events\n // options.attachViewHierarchy = true // This adds the view hierarchy to the error events\n }\n // Remove the next line after confirming that your Sentry integration is working.\n SentrySDK.capture(message: \"This app uses Sentry! :)\")\n`,\n );\n });\n });\n\n describe('getObjcSnippet', () => {\n it('should return the correct snippet', () => {\n // -- Arrange --\n const snippet = getObjcSnippet('test-dsn');\n\n // -- Assert --\n expect(snippet).toBe(\n ` [SentrySDK startWithConfigureOptions:^(SentryOptions * options) {\n options.dsn = @\"test-dsn\";\n options.debug = YES; // Enabled debug when first installing is always helpful\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = @1.0;\n\n // Sample rate for profiling, applied on top of TracesSampleRate.\n // We recommend adjusting this value in production.\n options.profilesSampleRate = @1.0;\n\n //Uncomment the following lines to add more data to your events\n //options.attachScreenshot = YES; //This will add a screenshot to the error events\n //options.attachViewHierarchy = YES; //This will add the view hierarchy to the error events\n }];\n //Remove the next line after confirming that your Sentry integration is working.\n [SentrySDK captureMessage:@\"This app uses Sentry!\"];\n`,\n );\n });\n });\n\n describe('getFastlaneSnippet', () => {\n it('should return the correct snippet', () => {\n // -- Arrange --\n const snippet = getFastlaneSnippet('test-org', 'test-project');\n\n // -- Assert --\n expect(snippet).toBe(\n ` sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )`,\n );\n });\n });\n});\n"]}
|