@sentry/wizard 4.6.0 → 4.8.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 +19 -0
- package/README.md +19 -19
- package/dist/bin.js +9 -0
- package/dist/bin.js.map +1 -1
- package/dist/e2e-tests/tests/angular-17.test.d.ts +1 -0
- package/dist/e2e-tests/tests/angular-17.test.js +196 -0
- package/dist/e2e-tests/tests/angular-17.test.js.map +1 -0
- package/dist/e2e-tests/tests/angular-19.test.d.ts +1 -0
- package/dist/e2e-tests/tests/angular-19.test.js +194 -0
- package/dist/e2e-tests/tests/angular-19.test.js.map +1 -0
- package/dist/e2e-tests/tests/expo.test.d.ts +1 -0
- package/dist/e2e-tests/tests/expo.test.js +95 -0
- package/dist/e2e-tests/tests/expo.test.js.map +1 -0
- package/dist/e2e-tests/tests/flutter.test.js +16 -16
- package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
- package/dist/e2e-tests/tests/help-message.test.d.ts +1 -0
- package/dist/e2e-tests/tests/help-message.test.js +56 -0
- package/dist/e2e-tests/tests/help-message.test.js.map +1 -0
- package/dist/e2e-tests/tests/nextjs-14.test.js +15 -15
- package/dist/e2e-tests/tests/nextjs-14.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs-15.test.js +15 -15
- package/dist/e2e-tests/tests/nextjs-15.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-3.test.js +13 -12
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js +13 -12
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
- package/dist/e2e-tests/tests/react-native.test.d.ts +1 -0
- package/dist/e2e-tests/tests/react-native.test.js +97 -0
- package/dist/e2e-tests/tests/react-native.test.js.map +1 -0
- package/dist/e2e-tests/tests/remix.test.js +24 -24
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit.test.js +22 -22
- package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
- package/dist/e2e-tests/utils/index.d.ts +7 -0
- package/dist/e2e-tests/utils/index.js +33 -12
- package/dist/e2e-tests/utils/index.js.map +1 -1
- package/dist/lib/Constants.d.ts +6 -1
- package/dist/lib/Constants.js +3 -0
- package/dist/lib/Constants.js.map +1 -1
- package/dist/lib/Helper/Logging.d.ts +1 -1
- package/dist/lib/Helper/Logging.js.map +1 -1
- package/dist/lib/Helper/__tests__/File.js +9 -9
- package/dist/lib/Helper/__tests__/File.js.map +1 -1
- package/dist/lib/Helper/__tests__/MergeConfig.js +17 -17
- package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/__tests__/SentryCli.js +23 -22
- package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
- package/dist/lib/Setup.d.ts +2 -1
- package/dist/lib/Setup.js +12 -2
- package/dist/lib/Setup.js.map +1 -1
- package/dist/lib/Steps/BaseStep.d.ts +1 -1
- package/dist/lib/Steps/BaseStep.js.map +1 -1
- package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
- package/dist/lib/Steps/Welcome.js +5 -0
- package/dist/lib/Steps/Welcome.js.map +1 -1
- package/dist/lib/__tests__/Env.js +4 -3
- package/dist/lib/__tests__/Env.js.map +1 -1
- package/dist/src/angular/angular-wizard.d.ts +3 -0
- package/dist/src/angular/angular-wizard.js +186 -0
- package/dist/src/angular/angular-wizard.js.map +1 -0
- package/dist/src/angular/codemods/app-config.d.ts +3 -0
- package/dist/src/angular/codemods/app-config.js +211 -0
- package/dist/src/angular/codemods/app-config.js.map +1 -0
- package/dist/src/angular/codemods/main.d.ts +20 -0
- package/dist/src/angular/codemods/main.js +62 -0
- package/dist/src/angular/codemods/main.js.map +1 -0
- package/dist/src/angular/codemods/sourcemaps.d.ts +21 -0
- package/dist/src/angular/codemods/sourcemaps.js +94 -0
- package/dist/src/angular/codemods/sourcemaps.js.map +1 -0
- package/dist/src/angular/example-component.d.ts +8 -0
- package/dist/src/angular/example-component.js +286 -0
- package/dist/src/angular/example-component.js.map +1 -0
- package/dist/src/angular/sdk-setup.d.ts +6 -0
- package/dist/src/angular/sdk-setup.js +99 -0
- package/dist/src/angular/sdk-setup.js.map +1 -0
- package/dist/src/apple/apple-wizard.js +24 -64
- package/dist/src/apple/apple-wizard.js.map +1 -1
- package/dist/src/apple/configure-package-manager.d.ts +5 -0
- package/dist/src/apple/configure-package-manager.js +68 -0
- package/dist/src/apple/configure-package-manager.js.map +1 -0
- package/dist/src/apple/configure-sentry-cli.d.ts +4 -0
- package/dist/src/apple/configure-sentry-cli.js +47 -0
- package/dist/src/apple/configure-sentry-cli.js.map +1 -0
- package/dist/src/apple/configure-xcode-project.d.ts +8 -0
- package/dist/src/apple/configure-xcode-project.js +11 -0
- package/dist/src/apple/configure-xcode-project.js.map +1 -0
- package/dist/src/apple/inject-code-snippet.d.ts +6 -0
- package/dist/src/apple/inject-code-snippet.js +54 -0
- package/dist/src/apple/inject-code-snippet.js.map +1 -0
- package/dist/src/apple/templates.js +11 -7
- package/dist/src/apple/templates.js.map +1 -1
- package/dist/src/apple/xcode-manager.js +3 -6
- package/dist/src/apple/xcode-manager.js.map +1 -1
- package/dist/src/flutter/flutter-wizard.js +10 -2
- package/dist/src/flutter/flutter-wizard.js.map +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +26 -12
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nextjs/templates.js +59 -8
- package/dist/src/nextjs/templates.js.map +1 -1
- package/dist/src/nuxt/templates.js +30 -0
- package/dist/src/nuxt/templates.js.map +1 -1
- package/dist/src/react-native/expo-metro.js +4 -1
- package/dist/src/react-native/expo-metro.js.map +1 -1
- package/dist/src/react-native/expo.js +5 -1
- package/dist/src/react-native/expo.js.map +1 -1
- package/dist/src/react-native/javascript.d.ts +6 -4
- package/dist/src/react-native/javascript.js +33 -10
- package/dist/src/react-native/javascript.js.map +1 -1
- package/dist/src/react-native/metro.js +8 -2
- package/dist/src/react-native/metro.js.map +1 -1
- package/dist/src/react-native/react-native-wizard.d.ts +4 -0
- package/dist/src/react-native/react-native-wizard.js +30 -5
- package/dist/src/react-native/react-native-wizard.js.map +1 -1
- package/dist/src/react-native/xcode.d.ts +7 -3
- package/dist/src/react-native/xcode.js +68 -20
- package/dist/src/react-native/xcode.js.map +1 -1
- package/dist/src/remix/sdk-example.js +30 -1
- package/dist/src/remix/sdk-example.js.map +1 -1
- package/dist/src/remix/sdk-setup.js +11 -5
- package/dist/src/remix/sdk-setup.js.map +1 -1
- package/dist/src/run.d.ts +1 -1
- package/dist/src/run.js +7 -2
- package/dist/src/run.js.map +1 -1
- package/dist/src/sourcemaps/sourcemaps-wizard.d.ts +1 -1
- package/dist/src/sourcemaps/sourcemaps-wizard.js +35 -20
- package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
- package/dist/src/sourcemaps/tools/angular.d.ts +1 -0
- package/dist/src/sourcemaps/tools/angular.js +7 -7
- package/dist/src/sourcemaps/tools/angular.js.map +1 -1
- package/dist/src/sourcemaps/tools/sentry-cli.d.ts +5 -1
- package/dist/src/sourcemaps/tools/sentry-cli.js +6 -3
- package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
- package/dist/src/sourcemaps/tools/tsc.js +5 -1
- package/dist/src/sourcemaps/tools/tsc.js.map +1 -1
- package/dist/src/sourcemaps/tools/vite.js +4 -1
- package/dist/src/sourcemaps/tools/vite.js.map +1 -1
- package/dist/src/sourcemaps/tools/webpack.js +4 -1
- package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
- package/dist/src/sveltekit/sdk-example.js +1 -1
- package/dist/src/sveltekit/sdk-example.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +2 -2
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/src/sveltekit/templates.js +28 -1
- package/dist/src/sveltekit/templates.js.map +1 -1
- package/dist/src/utils/clack/index.d.ts +11 -3
- package/dist/src/utils/clack/index.js +12 -4
- package/dist/src/utils/clack/index.js.map +1 -1
- package/dist/src/utils/package-manager.d.ts +2 -0
- package/dist/src/utils/package-manager.js +55 -5
- package/dist/src/utils/package-manager.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/android/code-tools.test.js +13 -12
- package/dist/test/android/code-tools.test.js.map +1 -1
- package/dist/test/angular/angular-wizard.test.d.ts +1 -0
- package/dist/test/angular/angular-wizard.test.js +27 -0
- package/dist/test/angular/angular-wizard.test.js.map +1 -0
- package/dist/test/angular/codemods/sourcemaps.test.d.ts +1 -0
- package/dist/test/angular/codemods/sourcemaps.test.js +237 -0
- package/dist/test/angular/codemods/sourcemaps.test.js.map +1 -0
- package/dist/test/angular/example-component.test.d.ts +1 -0
- package/dist/test/angular/example-component.test.js +105 -0
- package/dist/test/angular/example-component.test.js.map +1 -0
- package/dist/test/apple/cocoapod.test.js +77 -72
- package/dist/test/apple/cocoapod.test.js.map +1 -1
- package/dist/test/apple/code-tools.test.js +173 -166
- package/dist/test/apple/code-tools.test.js.map +1 -1
- package/dist/test/apple/fastfile.test.js +86 -83
- package/dist/test/apple/fastfile.test.js.map +1 -1
- package/dist/test/apple/templates.test.js +32 -27
- package/dist/test/apple/templates.test.js.map +1 -1
- package/dist/test/apple/xcode-manager.test.js +182 -183
- package/dist/test/apple/xcode-manager.test.js.map +1 -1
- package/dist/test/flutter/code-tools.test.js +29 -28
- package/dist/test/flutter/code-tools.test.js.map +1 -1
- package/dist/test/flutter/templates.test.js +15 -14
- package/dist/test/flutter/templates.test.js.map +1 -1
- package/dist/test/nextjs/templates.test.js +43 -36
- package/dist/test/nextjs/templates.test.js.map +1 -1
- package/dist/test/nuxt/templates.test.js +25 -24
- package/dist/test/nuxt/templates.test.js.map +1 -1
- package/dist/test/react-native/expo-metro.test.js +11 -10
- package/dist/test/react-native/expo-metro.test.js.map +1 -1
- package/dist/test/react-native/expo.test.js +11 -10
- package/dist/test/react-native/expo.test.js.map +1 -1
- package/dist/test/react-native/gradle.test.js +27 -26
- package/dist/test/react-native/gradle.test.js.map +1 -1
- package/dist/test/react-native/javascript.test.js +108 -58
- package/dist/test/react-native/javascript.test.js.map +1 -1
- package/dist/test/react-native/metro.test.js +178 -64
- package/dist/test/react-native/metro.test.js.map +1 -1
- package/dist/test/react-native/xcode.test.js +138 -37
- package/dist/test/react-native/xcode.test.js.map +1 -1
- package/dist/test/remix/client-entry.test.js +18 -17
- package/dist/test/remix/client-entry.test.js.map +1 -1
- package/dist/test/remix/server-instrumentation.test.js +6 -5
- package/dist/test/remix/server-instrumentation.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/sentry-cli.test.js +20 -20
- package/dist/test/sourcemaps/tools/sentry-cli.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/tsc.test.js +13 -14
- package/dist/test/sourcemaps/tools/tsc.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/vite.test.js +13 -14
- package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/webpack.test.js +19 -20
- package/dist/test/sourcemaps/tools/webpack.test.js.map +1 -1
- package/dist/test/sveltekit/templates.test.js +13 -12
- package/dist/test/sveltekit/templates.test.js.map +1 -1
- package/dist/test/utils/ast-utils.test.js +45 -44
- package/dist/test/utils/ast-utils.test.js.map +1 -1
- package/dist/test/utils/clack/index.test.js +140 -144
- package/dist/test/utils/clack/index.test.js.map +1 -1
- package/dist/test/utils/package-manager.test.js +8 -7
- package/dist/test/utils/package-manager.test.js.map +1 -1
- package/package.json +10 -38
- package/dist/e2e-tests/jest.config.d.ts +0 -17
- package/dist/e2e-tests/jest.config.js +0 -23
- package/dist/e2e-tests/jest.config.js.map +0 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
3
4
|
const templates_1 = require("../../src/apple/templates");
|
|
4
|
-
describe('templates', () => {
|
|
5
|
-
describe('getRunScriptTemplate', () => {
|
|
5
|
+
(0, vitest_1.describe)('templates', () => {
|
|
6
|
+
(0, vitest_1.describe)('getRunScriptTemplate', () => {
|
|
6
7
|
const variations = [
|
|
7
8
|
{
|
|
8
9
|
uploadSource: true,
|
|
9
10
|
includeHomebrewPath: true,
|
|
10
|
-
expectedScript: `# This script is
|
|
11
|
+
expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.
|
|
11
12
|
if [[ "$(uname -m)" == arm64 ]]; then
|
|
12
13
|
export PATH="/opt/homebrew/bin:$PATH"
|
|
13
14
|
fi
|
|
@@ -26,7 +27,7 @@ fi
|
|
|
26
27
|
{
|
|
27
28
|
uploadSource: true,
|
|
28
29
|
includeHomebrewPath: false,
|
|
29
|
-
expectedScript: `# This script is
|
|
30
|
+
expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.
|
|
30
31
|
if which sentry-cli >/dev/null; then
|
|
31
32
|
export SENTRY_ORG=test-org
|
|
32
33
|
export SENTRY_PROJECT=test-project
|
|
@@ -42,7 +43,7 @@ fi
|
|
|
42
43
|
{
|
|
43
44
|
uploadSource: false,
|
|
44
45
|
includeHomebrewPath: true,
|
|
45
|
-
expectedScript: `# This script is
|
|
46
|
+
expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.
|
|
46
47
|
if [[ "$(uname -m)" == arm64 ]]; then
|
|
47
48
|
export PATH="/opt/homebrew/bin:$PATH"
|
|
48
49
|
fi
|
|
@@ -61,7 +62,7 @@ fi
|
|
|
61
62
|
{
|
|
62
63
|
uploadSource: false,
|
|
63
64
|
includeHomebrewPath: false,
|
|
64
|
-
expectedScript: `# This script is
|
|
65
|
+
expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.
|
|
65
66
|
if which sentry-cli >/dev/null; then
|
|
66
67
|
export SENTRY_ORG=test-org
|
|
67
68
|
export SENTRY_PROJECT=test-project
|
|
@@ -76,36 +77,38 @@ fi
|
|
|
76
77
|
},
|
|
77
78
|
];
|
|
78
79
|
for (const variation of variations) {
|
|
79
|
-
describe(`uploadSource: ${variation.uploadSource.toString()} and includeHomebrewPath: ${variation.includeHomebrewPath.toString()}`, () => {
|
|
80
|
-
it('should return the correct script', () => {
|
|
80
|
+
(0, vitest_1.describe)(`uploadSource: ${variation.uploadSource.toString()} and includeHomebrewPath: ${variation.includeHomebrewPath.toString()}`, () => {
|
|
81
|
+
(0, vitest_1.it)('should return the correct script', () => {
|
|
81
82
|
// -- ct --
|
|
82
83
|
const script = (0, templates_1.getRunScriptTemplate)('test-org', 'test-project', variation.uploadSource, variation.includeHomebrewPath);
|
|
83
84
|
// -- Assert --
|
|
84
|
-
expect(script).toBe(variation.expectedScript);
|
|
85
|
+
(0, vitest_1.expect)(script).toBe(variation.expectedScript);
|
|
85
86
|
});
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
89
|
});
|
|
89
|
-
describe('scriptInputPath', () => {
|
|
90
|
-
it('should return the correct path', () => {
|
|
91
|
-
expect(templates_1.scriptInputPath).toBe('"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}"');
|
|
90
|
+
(0, vitest_1.describe)('scriptInputPath', () => {
|
|
91
|
+
(0, vitest_1.it)('should return the correct path', () => {
|
|
92
|
+
(0, vitest_1.expect)(templates_1.scriptInputPath).toBe('"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}"');
|
|
92
93
|
});
|
|
93
94
|
});
|
|
94
|
-
describe('getSwiftSnippet', () => {
|
|
95
|
-
it('should return the correct snippet', () => {
|
|
95
|
+
(0, vitest_1.describe)('getSwiftSnippet', () => {
|
|
96
|
+
(0, vitest_1.it)('should return the correct snippet', () => {
|
|
96
97
|
// -- Arrange --
|
|
97
98
|
const snippet = (0, templates_1.getSwiftSnippet)('test-dsn');
|
|
98
99
|
// -- Assert --
|
|
99
|
-
expect(snippet).toBe(` SentrySDK.start { options in
|
|
100
|
+
(0, vitest_1.expect)(snippet).toBe(` SentrySDK.start { options in
|
|
100
101
|
options.dsn = "test-dsn"
|
|
101
102
|
options.debug = true // Enabled debug when first installing is always helpful
|
|
102
103
|
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
|
|
103
104
|
// We recommend adjusting this value in production.
|
|
104
105
|
options.tracesSampleRate = 1.0
|
|
105
106
|
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
// Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.
|
|
108
|
+
options.configureProfiling = {
|
|
109
|
+
$0.sessionSampleRate = 1.0 // We recommend adjusting this value in production.
|
|
110
|
+
$0.lifecycle = .trace
|
|
111
|
+
}
|
|
109
112
|
|
|
110
113
|
// Uncomment the following lines to add more data to your events
|
|
111
114
|
// options.attachScreenshot = true // This adds a screenshot to the error events
|
|
@@ -116,21 +119,23 @@ fi
|
|
|
116
119
|
`);
|
|
117
120
|
});
|
|
118
121
|
});
|
|
119
|
-
describe('getObjcSnippet', () => {
|
|
120
|
-
it('should return the correct snippet', () => {
|
|
122
|
+
(0, vitest_1.describe)('getObjcSnippet', () => {
|
|
123
|
+
(0, vitest_1.it)('should return the correct snippet', () => {
|
|
121
124
|
// -- Arrange --
|
|
122
125
|
const snippet = (0, templates_1.getObjcSnippet)('test-dsn');
|
|
123
126
|
// -- Assert --
|
|
124
|
-
expect(snippet).toBe(` [SentrySDK startWithConfigureOptions:^(SentryOptions * options) {
|
|
127
|
+
(0, vitest_1.expect)(snippet).toBe(` [SentrySDK startWithConfigureOptions:^(SentryOptions * options) {
|
|
125
128
|
options.dsn = @"test-dsn";
|
|
126
129
|
options.debug = YES; // Enabled debug when first installing is always helpful
|
|
127
130
|
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
|
|
128
131
|
// We recommend adjusting this value in production.
|
|
129
132
|
options.tracesSampleRate = @1.0;
|
|
130
133
|
|
|
131
|
-
//
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
// Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.
|
|
135
|
+
options.configureProfiling = ^(SentryProfileOptions *profiling) {
|
|
136
|
+
profiling.sessionSampleRate = 1.0; // We recommend adjusting this value in production.
|
|
137
|
+
profiling.lifecycle = SentryProfilingLifecycleTrace;
|
|
138
|
+
};
|
|
134
139
|
|
|
135
140
|
//Uncomment the following lines to add more data to your events
|
|
136
141
|
//options.attachScreenshot = YES; //This will add a screenshot to the error events
|
|
@@ -141,12 +146,12 @@ fi
|
|
|
141
146
|
`);
|
|
142
147
|
});
|
|
143
148
|
});
|
|
144
|
-
describe('getFastlaneSnippet', () => {
|
|
145
|
-
it('should return the correct snippet', () => {
|
|
149
|
+
(0, vitest_1.describe)('getFastlaneSnippet', () => {
|
|
150
|
+
(0, vitest_1.it)('should return the correct snippet', () => {
|
|
146
151
|
// -- Arrange --
|
|
147
152
|
const snippet = (0, templates_1.getFastlaneSnippet)('test-org', 'test-project');
|
|
148
153
|
// -- Assert --
|
|
149
|
-
expect(snippet).toBe(` sentry_cli(
|
|
154
|
+
(0, vitest_1.expect)(snippet).toBe(` sentry_cli(
|
|
150
155
|
org_slug: 'test-org',
|
|
151
156
|
project_slug: 'test-project',
|
|
152
157
|
include_sources: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/apple/templates.test.ts"],"names":[],"mappings":";;AAAA,yDAMmC;AAEnC,
|
|
1
|
+
{"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/apple/templates.test.ts"],"names":[],"mappings":";;AAAA,mCAA8C;AAC9C,yDAMmC;AAEnC,IAAA,iBAAQ,EAAC,WAAW,EAAE,GAAG,EAAE;IACzB,IAAA,iBAAQ,EAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,MAAM,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et,\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 responsible for uploading 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 responsible for uploading 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 responsible for uploading 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 responsible for uploading 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 // Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.\n options.configureProfiling = {\n $0.sessionSampleRate = 1.0 // We recommend adjusting this value in production.\n $0.lifecycle = .trace\n }\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 // Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.\n options.configureProfiling = ^(SentryProfileOptions *profiling) {\n profiling.sessionSampleRate = 1.0; // We recommend adjusting this value in production.\n profiling.lifecycle = SentryProfilingLifecycleTrace;\n };\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"]}
|