@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.
Files changed (218) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +19 -19
  3. package/dist/bin.js +9 -0
  4. package/dist/bin.js.map +1 -1
  5. package/dist/e2e-tests/tests/angular-17.test.d.ts +1 -0
  6. package/dist/e2e-tests/tests/angular-17.test.js +196 -0
  7. package/dist/e2e-tests/tests/angular-17.test.js.map +1 -0
  8. package/dist/e2e-tests/tests/angular-19.test.d.ts +1 -0
  9. package/dist/e2e-tests/tests/angular-19.test.js +194 -0
  10. package/dist/e2e-tests/tests/angular-19.test.js.map +1 -0
  11. package/dist/e2e-tests/tests/expo.test.d.ts +1 -0
  12. package/dist/e2e-tests/tests/expo.test.js +95 -0
  13. package/dist/e2e-tests/tests/expo.test.js.map +1 -0
  14. package/dist/e2e-tests/tests/flutter.test.js +16 -16
  15. package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
  16. package/dist/e2e-tests/tests/help-message.test.d.ts +1 -0
  17. package/dist/e2e-tests/tests/help-message.test.js +56 -0
  18. package/dist/e2e-tests/tests/help-message.test.js.map +1 -0
  19. package/dist/e2e-tests/tests/nextjs-14.test.js +15 -15
  20. package/dist/e2e-tests/tests/nextjs-14.test.js.map +1 -1
  21. package/dist/e2e-tests/tests/nextjs-15.test.js +15 -15
  22. package/dist/e2e-tests/tests/nextjs-15.test.js.map +1 -1
  23. package/dist/e2e-tests/tests/nuxt-3.test.js +13 -12
  24. package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
  25. package/dist/e2e-tests/tests/nuxt-4.test.js +13 -12
  26. package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
  27. package/dist/e2e-tests/tests/react-native.test.d.ts +1 -0
  28. package/dist/e2e-tests/tests/react-native.test.js +97 -0
  29. package/dist/e2e-tests/tests/react-native.test.js.map +1 -0
  30. package/dist/e2e-tests/tests/remix.test.js +24 -24
  31. package/dist/e2e-tests/tests/remix.test.js.map +1 -1
  32. package/dist/e2e-tests/tests/sveltekit.test.js +22 -22
  33. package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
  34. package/dist/e2e-tests/utils/index.d.ts +7 -0
  35. package/dist/e2e-tests/utils/index.js +33 -12
  36. package/dist/e2e-tests/utils/index.js.map +1 -1
  37. package/dist/lib/Constants.d.ts +6 -1
  38. package/dist/lib/Constants.js +3 -0
  39. package/dist/lib/Constants.js.map +1 -1
  40. package/dist/lib/Helper/Logging.d.ts +1 -1
  41. package/dist/lib/Helper/Logging.js.map +1 -1
  42. package/dist/lib/Helper/__tests__/File.js +9 -9
  43. package/dist/lib/Helper/__tests__/File.js.map +1 -1
  44. package/dist/lib/Helper/__tests__/MergeConfig.js +17 -17
  45. package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
  46. package/dist/lib/Helper/__tests__/SentryCli.js +23 -22
  47. package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
  48. package/dist/lib/Setup.d.ts +2 -1
  49. package/dist/lib/Setup.js +12 -2
  50. package/dist/lib/Setup.js.map +1 -1
  51. package/dist/lib/Steps/BaseStep.d.ts +1 -1
  52. package/dist/lib/Steps/BaseStep.js.map +1 -1
  53. package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
  54. package/dist/lib/Steps/Welcome.js +5 -0
  55. package/dist/lib/Steps/Welcome.js.map +1 -1
  56. package/dist/lib/__tests__/Env.js +4 -3
  57. package/dist/lib/__tests__/Env.js.map +1 -1
  58. package/dist/src/angular/angular-wizard.d.ts +3 -0
  59. package/dist/src/angular/angular-wizard.js +186 -0
  60. package/dist/src/angular/angular-wizard.js.map +1 -0
  61. package/dist/src/angular/codemods/app-config.d.ts +3 -0
  62. package/dist/src/angular/codemods/app-config.js +211 -0
  63. package/dist/src/angular/codemods/app-config.js.map +1 -0
  64. package/dist/src/angular/codemods/main.d.ts +20 -0
  65. package/dist/src/angular/codemods/main.js +62 -0
  66. package/dist/src/angular/codemods/main.js.map +1 -0
  67. package/dist/src/angular/codemods/sourcemaps.d.ts +21 -0
  68. package/dist/src/angular/codemods/sourcemaps.js +94 -0
  69. package/dist/src/angular/codemods/sourcemaps.js.map +1 -0
  70. package/dist/src/angular/example-component.d.ts +8 -0
  71. package/dist/src/angular/example-component.js +286 -0
  72. package/dist/src/angular/example-component.js.map +1 -0
  73. package/dist/src/angular/sdk-setup.d.ts +6 -0
  74. package/dist/src/angular/sdk-setup.js +99 -0
  75. package/dist/src/angular/sdk-setup.js.map +1 -0
  76. package/dist/src/apple/apple-wizard.js +24 -64
  77. package/dist/src/apple/apple-wizard.js.map +1 -1
  78. package/dist/src/apple/configure-package-manager.d.ts +5 -0
  79. package/dist/src/apple/configure-package-manager.js +68 -0
  80. package/dist/src/apple/configure-package-manager.js.map +1 -0
  81. package/dist/src/apple/configure-sentry-cli.d.ts +4 -0
  82. package/dist/src/apple/configure-sentry-cli.js +47 -0
  83. package/dist/src/apple/configure-sentry-cli.js.map +1 -0
  84. package/dist/src/apple/configure-xcode-project.d.ts +8 -0
  85. package/dist/src/apple/configure-xcode-project.js +11 -0
  86. package/dist/src/apple/configure-xcode-project.js.map +1 -0
  87. package/dist/src/apple/inject-code-snippet.d.ts +6 -0
  88. package/dist/src/apple/inject-code-snippet.js +54 -0
  89. package/dist/src/apple/inject-code-snippet.js.map +1 -0
  90. package/dist/src/apple/templates.js +11 -7
  91. package/dist/src/apple/templates.js.map +1 -1
  92. package/dist/src/apple/xcode-manager.js +3 -6
  93. package/dist/src/apple/xcode-manager.js.map +1 -1
  94. package/dist/src/flutter/flutter-wizard.js +10 -2
  95. package/dist/src/flutter/flutter-wizard.js.map +1 -1
  96. package/dist/src/nextjs/nextjs-wizard.js +26 -12
  97. package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
  98. package/dist/src/nextjs/templates.js +59 -8
  99. package/dist/src/nextjs/templates.js.map +1 -1
  100. package/dist/src/nuxt/templates.js +30 -0
  101. package/dist/src/nuxt/templates.js.map +1 -1
  102. package/dist/src/react-native/expo-metro.js +4 -1
  103. package/dist/src/react-native/expo-metro.js.map +1 -1
  104. package/dist/src/react-native/expo.js +5 -1
  105. package/dist/src/react-native/expo.js.map +1 -1
  106. package/dist/src/react-native/javascript.d.ts +6 -4
  107. package/dist/src/react-native/javascript.js +33 -10
  108. package/dist/src/react-native/javascript.js.map +1 -1
  109. package/dist/src/react-native/metro.js +8 -2
  110. package/dist/src/react-native/metro.js.map +1 -1
  111. package/dist/src/react-native/react-native-wizard.d.ts +4 -0
  112. package/dist/src/react-native/react-native-wizard.js +30 -5
  113. package/dist/src/react-native/react-native-wizard.js.map +1 -1
  114. package/dist/src/react-native/xcode.d.ts +7 -3
  115. package/dist/src/react-native/xcode.js +68 -20
  116. package/dist/src/react-native/xcode.js.map +1 -1
  117. package/dist/src/remix/sdk-example.js +30 -1
  118. package/dist/src/remix/sdk-example.js.map +1 -1
  119. package/dist/src/remix/sdk-setup.js +11 -5
  120. package/dist/src/remix/sdk-setup.js.map +1 -1
  121. package/dist/src/run.d.ts +1 -1
  122. package/dist/src/run.js +7 -2
  123. package/dist/src/run.js.map +1 -1
  124. package/dist/src/sourcemaps/sourcemaps-wizard.d.ts +1 -1
  125. package/dist/src/sourcemaps/sourcemaps-wizard.js +35 -20
  126. package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
  127. package/dist/src/sourcemaps/tools/angular.d.ts +1 -0
  128. package/dist/src/sourcemaps/tools/angular.js +7 -7
  129. package/dist/src/sourcemaps/tools/angular.js.map +1 -1
  130. package/dist/src/sourcemaps/tools/sentry-cli.d.ts +5 -1
  131. package/dist/src/sourcemaps/tools/sentry-cli.js +6 -3
  132. package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
  133. package/dist/src/sourcemaps/tools/tsc.js +5 -1
  134. package/dist/src/sourcemaps/tools/tsc.js.map +1 -1
  135. package/dist/src/sourcemaps/tools/vite.js +4 -1
  136. package/dist/src/sourcemaps/tools/vite.js.map +1 -1
  137. package/dist/src/sourcemaps/tools/webpack.js +4 -1
  138. package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
  139. package/dist/src/sveltekit/sdk-example.js +1 -1
  140. package/dist/src/sveltekit/sdk-example.js.map +1 -1
  141. package/dist/src/sveltekit/sveltekit-wizard.js +2 -2
  142. package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
  143. package/dist/src/sveltekit/templates.js +28 -1
  144. package/dist/src/sveltekit/templates.js.map +1 -1
  145. package/dist/src/utils/clack/index.d.ts +11 -3
  146. package/dist/src/utils/clack/index.js +12 -4
  147. package/dist/src/utils/clack/index.js.map +1 -1
  148. package/dist/src/utils/package-manager.d.ts +2 -0
  149. package/dist/src/utils/package-manager.js +55 -5
  150. package/dist/src/utils/package-manager.js.map +1 -1
  151. package/dist/src/version.d.ts +1 -1
  152. package/dist/src/version.js +1 -1
  153. package/dist/src/version.js.map +1 -1
  154. package/dist/test/android/code-tools.test.js +13 -12
  155. package/dist/test/android/code-tools.test.js.map +1 -1
  156. package/dist/test/angular/angular-wizard.test.d.ts +1 -0
  157. package/dist/test/angular/angular-wizard.test.js +27 -0
  158. package/dist/test/angular/angular-wizard.test.js.map +1 -0
  159. package/dist/test/angular/codemods/sourcemaps.test.d.ts +1 -0
  160. package/dist/test/angular/codemods/sourcemaps.test.js +237 -0
  161. package/dist/test/angular/codemods/sourcemaps.test.js.map +1 -0
  162. package/dist/test/angular/example-component.test.d.ts +1 -0
  163. package/dist/test/angular/example-component.test.js +105 -0
  164. package/dist/test/angular/example-component.test.js.map +1 -0
  165. package/dist/test/apple/cocoapod.test.js +77 -72
  166. package/dist/test/apple/cocoapod.test.js.map +1 -1
  167. package/dist/test/apple/code-tools.test.js +173 -166
  168. package/dist/test/apple/code-tools.test.js.map +1 -1
  169. package/dist/test/apple/fastfile.test.js +86 -83
  170. package/dist/test/apple/fastfile.test.js.map +1 -1
  171. package/dist/test/apple/templates.test.js +32 -27
  172. package/dist/test/apple/templates.test.js.map +1 -1
  173. package/dist/test/apple/xcode-manager.test.js +182 -183
  174. package/dist/test/apple/xcode-manager.test.js.map +1 -1
  175. package/dist/test/flutter/code-tools.test.js +29 -28
  176. package/dist/test/flutter/code-tools.test.js.map +1 -1
  177. package/dist/test/flutter/templates.test.js +15 -14
  178. package/dist/test/flutter/templates.test.js.map +1 -1
  179. package/dist/test/nextjs/templates.test.js +43 -36
  180. package/dist/test/nextjs/templates.test.js.map +1 -1
  181. package/dist/test/nuxt/templates.test.js +25 -24
  182. package/dist/test/nuxt/templates.test.js.map +1 -1
  183. package/dist/test/react-native/expo-metro.test.js +11 -10
  184. package/dist/test/react-native/expo-metro.test.js.map +1 -1
  185. package/dist/test/react-native/expo.test.js +11 -10
  186. package/dist/test/react-native/expo.test.js.map +1 -1
  187. package/dist/test/react-native/gradle.test.js +27 -26
  188. package/dist/test/react-native/gradle.test.js.map +1 -1
  189. package/dist/test/react-native/javascript.test.js +108 -58
  190. package/dist/test/react-native/javascript.test.js.map +1 -1
  191. package/dist/test/react-native/metro.test.js +178 -64
  192. package/dist/test/react-native/metro.test.js.map +1 -1
  193. package/dist/test/react-native/xcode.test.js +138 -37
  194. package/dist/test/react-native/xcode.test.js.map +1 -1
  195. package/dist/test/remix/client-entry.test.js +18 -17
  196. package/dist/test/remix/client-entry.test.js.map +1 -1
  197. package/dist/test/remix/server-instrumentation.test.js +6 -5
  198. package/dist/test/remix/server-instrumentation.test.js.map +1 -1
  199. package/dist/test/sourcemaps/tools/sentry-cli.test.js +20 -20
  200. package/dist/test/sourcemaps/tools/sentry-cli.test.js.map +1 -1
  201. package/dist/test/sourcemaps/tools/tsc.test.js +13 -14
  202. package/dist/test/sourcemaps/tools/tsc.test.js.map +1 -1
  203. package/dist/test/sourcemaps/tools/vite.test.js +13 -14
  204. package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
  205. package/dist/test/sourcemaps/tools/webpack.test.js +19 -20
  206. package/dist/test/sourcemaps/tools/webpack.test.js.map +1 -1
  207. package/dist/test/sveltekit/templates.test.js +13 -12
  208. package/dist/test/sveltekit/templates.test.js.map +1 -1
  209. package/dist/test/utils/ast-utils.test.js +45 -44
  210. package/dist/test/utils/ast-utils.test.js.map +1 -1
  211. package/dist/test/utils/clack/index.test.js +140 -144
  212. package/dist/test/utils/clack/index.test.js.map +1 -1
  213. package/dist/test/utils/package-manager.test.js +8 -7
  214. package/dist/test/utils/package-manager.test.js.map +1 -1
  215. package/package.json +10 -38
  216. package/dist/e2e-tests/jest.config.d.ts +0 -17
  217. package/dist/e2e-tests/jest.config.js +0 -23
  218. package/dist/e2e-tests/jest.config.js.map +0 -1
@@ -30,6 +30,7 @@ const path = __importStar(require("path"));
30
30
  const code_tools_1 = require("../../src/apple/code-tools");
31
31
  // @ts-expect-error - clack is ESM and TS complains about that. It works though
32
32
  const clack = __importStar(require("@clack/prompts"));
33
+ const vitest_1 = require("vitest");
33
34
  // Test Constants
34
35
  const invalidAppDelegateSwift = `func application() {}`;
35
36
  const validAppDelegateSwift = `
@@ -59,9 +60,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
59
60
  // We recommend adjusting this value in production.
60
61
  options.tracesSampleRate = 1.0
61
62
 
62
- // Sample rate for profiling, applied on top of TracesSampleRate.
63
- // We recommend adjusting this value in production.
64
- options.profilesSampleRate = 1.0
63
+ // Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.
64
+ options.configureProfiling = {
65
+ $0.sessionSampleRate = 1.0 // We recommend adjusting this value in production.
66
+ $0.lifecycle = .trace
67
+ }
65
68
 
66
69
  // Uncomment the following lines to add more data to your events
67
70
  // options.attachScreenshot = true // This adds a screenshot to the error events
@@ -111,9 +114,11 @@ const validAppDelegateObjCWithSentry = `@import Sentry;
111
114
  // We recommend adjusting this value in production.
112
115
  options.tracesSampleRate = @1.0;
113
116
 
114
- // Sample rate for profiling, applied on top of TracesSampleRate.
115
- // We recommend adjusting this value in production.
116
- options.profilesSampleRate = @1.0;
117
+ // Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.
118
+ options.configureProfiling = ^(SentryProfileOptions *profiling) {
119
+ profiling.sessionSampleRate = 1.0; // We recommend adjusting this value in production.
120
+ profiling.lifecycle = SentryProfilingLifecycleTrace;
121
+ };
117
122
 
118
123
  //Uncomment the following lines to add more data to your events
119
124
  //options.attachScreenshot = YES; //This will add a screenshot to the error events
@@ -159,9 +164,11 @@ struct TestApp: App {
159
164
  // We recommend adjusting this value in production.
160
165
  options.tracesSampleRate = 1.0
161
166
 
162
- // Sample rate for profiling, applied on top of TracesSampleRate.
163
- // We recommend adjusting this value in production.
164
- options.profilesSampleRate = 1.0
167
+ // Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.
168
+ options.configureProfiling = {
169
+ $0.sessionSampleRate = 1.0 // We recommend adjusting this value in production.
170
+ $0.lifecycle = .trace
171
+ }
165
172
 
166
173
  // Uncomment the following lines to add more data to your events
167
174
  // options.attachScreenshot = true // This adds a screenshot to the error events
@@ -187,25 +194,25 @@ const prepareAppDelegateFile = (dir, content, ext) => {
187
194
  };
188
195
  const dsn = 'https://example.com/sentry-dsn';
189
196
  // Mock Setup
190
- jest.mock('../../src/utils/bash');
191
- jest.spyOn(Sentry, 'setTag').mockImplementation();
192
- jest.spyOn(Sentry, 'captureException').mockImplementation();
197
+ vitest_1.vi.mock('../../src/utils/bash');
198
+ vitest_1.vi.spyOn(Sentry, 'setTag').mockImplementation(() => undefined);
199
+ vitest_1.vi.spyOn(Sentry, 'captureException').mockImplementation(() => 'id');
193
200
  // Test Suite
194
- describe('code-tools', () => {
195
- beforeEach(() => {
196
- jest.spyOn(clack.log, 'info').mockImplementation();
201
+ (0, vitest_1.describe)('code-tools', () => {
202
+ (0, vitest_1.beforeEach)(() => {
203
+ vitest_1.vi.spyOn(clack.log, 'info').mockImplementation(() => undefined);
197
204
  });
198
- afterEach(() => {
199
- jest.clearAllMocks();
205
+ (0, vitest_1.afterEach)(() => {
206
+ vitest_1.vi.clearAllMocks();
200
207
  });
201
- describe('#isAppDelegateFile', () => {
208
+ (0, vitest_1.describe)('#isAppDelegateFile', () => {
202
209
  const prepareTestFile = (content, ext) => {
203
210
  const tempDir = prepareTempDir();
204
211
  return prepareAppDelegateFile(tempDir, content, ext);
205
212
  };
206
- describe('swift files', () => {
207
- describe('swift app launch regex', () => {
208
- describe('valid cases', () => {
213
+ (0, vitest_1.describe)('swift files', () => {
214
+ (0, vitest_1.describe)('swift app launch regex', () => {
215
+ (0, vitest_1.describe)('valid cases', () => {
209
216
  const variations = [
210
217
  {
211
218
  name: 'with underscores',
@@ -229,18 +236,18 @@ describe('code-tools', () => {
229
236
  },
230
237
  ];
231
238
  for (const variation of variations) {
232
- describe(`${variation.name}`, () => {
233
- it(`should return true`, () => {
239
+ (0, vitest_1.describe)(`${variation.name}`, () => {
240
+ (0, vitest_1.it)(`should return true`, () => {
234
241
  // -- Arrange --
235
242
  const filePath = prepareTestFile(variation.code, 'swift');
236
243
  // -- Act --
237
244
  const result = code_tools_1.exportForTesting.isAppDelegateFile(filePath);
238
245
  // -- Assert --
239
- expect(result).toBeTruthy();
246
+ (0, vitest_1.expect)(result).toBeTruthy();
240
247
  });
241
248
  });
242
249
  }
243
- describe('invalid cases', () => {
250
+ (0, vitest_1.describe)('invalid cases', () => {
244
251
  const variations = [
245
252
  {
246
253
  name: 'missing application method',
@@ -256,14 +263,14 @@ describe('code-tools', () => {
256
263
  },
257
264
  ];
258
265
  for (const variation of variations) {
259
- describe(`${variation.name}`, () => {
260
- it('should return false', () => {
266
+ (0, vitest_1.describe)(`${variation.name}`, () => {
267
+ (0, vitest_1.it)('should return false', () => {
261
268
  // -- Arrange --
262
269
  const filePath = prepareTestFile(variation.code, 'swift');
263
270
  // -- Act --
264
271
  const result = code_tools_1.exportForTesting.isAppDelegateFile(filePath);
265
272
  // -- Assert --
266
- expect(result).toBeFalsy();
273
+ (0, vitest_1.expect)(result).toBeFalsy();
267
274
  });
268
275
  });
269
276
  }
@@ -271,8 +278,8 @@ describe('code-tools', () => {
271
278
  });
272
279
  });
273
280
  });
274
- describe('objc files', () => {
275
- describe('valid cases', () => {
281
+ (0, vitest_1.describe)('objc files', () => {
282
+ (0, vitest_1.describe)('valid cases', () => {
276
283
  const variations = [
277
284
  {
278
285
  name: 'basic',
@@ -284,19 +291,19 @@ describe('code-tools', () => {
284
291
  },
285
292
  ];
286
293
  for (const variation of variations) {
287
- describe(`${variation.name}`, () => {
288
- it('should return true', () => {
294
+ (0, vitest_1.describe)(`${variation.name}`, () => {
295
+ (0, vitest_1.it)('should return true', () => {
289
296
  // -- Arrange --
290
297
  const filePath = prepareTestFile(variation.code, 'm');
291
298
  // -- Act --
292
299
  const result = code_tools_1.exportForTesting.isAppDelegateFile(filePath);
293
300
  // -- Assert --
294
- expect(result).toBeTruthy();
301
+ (0, vitest_1.expect)(result).toBeTruthy();
295
302
  });
296
303
  });
297
304
  }
298
305
  });
299
- describe('invalid cases', () => {
306
+ (0, vitest_1.describe)('invalid cases', () => {
300
307
  const variations = [
301
308
  {
302
309
  name: 'missing application method',
@@ -304,21 +311,21 @@ describe('code-tools', () => {
304
311
  },
305
312
  ];
306
313
  for (const variation of variations) {
307
- describe(`${variation.name}`, () => {
308
- it('should return false', () => {
314
+ (0, vitest_1.describe)(`${variation.name}`, () => {
315
+ (0, vitest_1.it)('should return false', () => {
309
316
  // -- Arrange --
310
317
  const filePath = prepareTestFile(variation.code, 'm');
311
318
  // -- Act --
312
319
  const result = code_tools_1.exportForTesting.isAppDelegateFile(filePath);
313
320
  // -- Assert --
314
- expect(result).toBeFalsy();
321
+ (0, vitest_1.expect)(result).toBeFalsy();
315
322
  });
316
323
  });
317
324
  }
318
325
  });
319
326
  });
320
- describe('swiftui files', () => {
321
- describe('valid cases', () => {
327
+ (0, vitest_1.describe)('swiftui files', () => {
328
+ (0, vitest_1.describe)('valid cases', () => {
322
329
  const variations = [
323
330
  {
324
331
  name: 'basic',
@@ -334,19 +341,19 @@ describe('code-tools', () => {
334
341
  },
335
342
  ];
336
343
  for (const variation of variations) {
337
- describe(`${variation.name}`, () => {
338
- it('should return true', () => {
344
+ (0, vitest_1.describe)(`${variation.name}`, () => {
345
+ (0, vitest_1.it)('should return true', () => {
339
346
  // -- Arrange --
340
347
  const filePath = prepareTestFile(variation.code, 'swift');
341
348
  // -- Act --
342
349
  const result = code_tools_1.exportForTesting.isAppDelegateFile(filePath);
343
350
  // -- Assert --
344
- expect(result).toBeTruthy();
351
+ (0, vitest_1.expect)(result).toBeTruthy();
345
352
  });
346
353
  });
347
354
  }
348
355
  });
349
- describe('invalid cases', () => {
356
+ (0, vitest_1.describe)('invalid cases', () => {
350
357
  const variations = [
351
358
  {
352
359
  name: 'missing @main',
@@ -366,161 +373,161 @@ describe('code-tools', () => {
366
373
  },
367
374
  ];
368
375
  for (const variation of variations) {
369
- describe(`${variation.name}`, () => {
370
- it('should return false', () => {
376
+ (0, vitest_1.describe)(`${variation.name}`, () => {
377
+ (0, vitest_1.it)('should return false', () => {
371
378
  // -- Arrange --
372
379
  const filePath = prepareTestFile(variation.code, 'swift');
373
380
  // -- Act --
374
381
  const result = code_tools_1.exportForTesting.isAppDelegateFile(filePath);
375
382
  // -- Assert --
376
- expect(result).toBeFalsy();
383
+ (0, vitest_1.expect)(result).toBeFalsy();
377
384
  });
378
385
  });
379
386
  }
380
387
  });
381
388
  });
382
- describe('file not found', () => {
383
- it('should throw an error', () => {
389
+ (0, vitest_1.describe)('file not found', () => {
390
+ (0, vitest_1.it)('should throw an error', () => {
384
391
  // -- Arrange --
385
392
  const invalidPath = path.join(os.tmpdir(), 'invalid-path');
386
393
  // -- Act & Assert --
387
- expect(() => code_tools_1.exportForTesting.isAppDelegateFile(invalidPath)).toThrow();
394
+ (0, vitest_1.expect)(() => code_tools_1.exportForTesting.isAppDelegateFile(invalidPath)).toThrow();
388
395
  });
389
396
  });
390
397
  });
391
- describe('#findAppDidFinishLaunchingWithOptions', () => {
392
- describe('no files given', () => {
393
- it('should check files in directory', () => {
398
+ (0, vitest_1.describe)('#findAppDidFinishLaunchingWithOptions', () => {
399
+ (0, vitest_1.describe)('no files given', () => {
400
+ (0, vitest_1.it)('should check files in directory', () => {
394
401
  // -- Arrange --
395
402
  const tempDir = prepareTempDir();
396
403
  const filePath = prepareAppDelegateFile(tempDir, validAppDelegateSwift, 'swift');
397
404
  // -- Act --
398
405
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir);
399
406
  // -- Assert --
400
- expect(result).toBe(filePath);
407
+ (0, vitest_1.expect)(result).toBe(filePath);
401
408
  });
402
409
  });
403
- describe('SwiftUI file found', () => {
404
- describe('is app delegate', () => {
405
- it('should return the file path', () => {
410
+ (0, vitest_1.describe)('SwiftUI file found', () => {
411
+ (0, vitest_1.describe)('is app delegate', () => {
412
+ (0, vitest_1.it)('should return the file path', () => {
406
413
  // -- Arrange --
407
414
  const tempDir = prepareTempDir();
408
415
  const filePath = prepareAppDelegateFile(tempDir, validAppDelegateSwiftUI, 'swift');
409
416
  // -- Act --
410
417
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir);
411
418
  // -- Assert --
412
- expect(result).toBe(filePath);
419
+ (0, vitest_1.expect)(result).toBe(filePath);
413
420
  });
414
421
  });
415
- describe('is not app delegate', () => {
416
- it('should be ignored', () => {
422
+ (0, vitest_1.describe)('is not app delegate', () => {
423
+ (0, vitest_1.it)('should be ignored', () => {
417
424
  // -- Arrange --
418
425
  const tempDir = prepareTempDir();
419
426
  prepareAppDelegateFile(tempDir, invalidAppDelegateSwiftUI, 'swift');
420
427
  // -- Act --
421
428
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir);
422
429
  // -- Assert --
423
- expect(result).toBeNull();
430
+ (0, vitest_1.expect)(result).toBeNull();
424
431
  });
425
432
  });
426
433
  });
427
- describe('Swift file found', () => {
428
- describe('is app delegate', () => {
429
- it('should return the file path', () => {
434
+ (0, vitest_1.describe)('Swift file found', () => {
435
+ (0, vitest_1.describe)('is app delegate', () => {
436
+ (0, vitest_1.it)('should return the file path', () => {
430
437
  // -- Arrange --
431
438
  const tempDir = prepareTempDir();
432
439
  const filePath = prepareAppDelegateFile(tempDir, validAppDelegateSwift, 'swift');
433
440
  // -- Act --
434
441
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir);
435
442
  // -- Assert --
436
- expect(result).toBe(filePath);
443
+ (0, vitest_1.expect)(result).toBe(filePath);
437
444
  });
438
445
  });
439
- describe('is not app delegate', () => {
440
- it('should be ignored', () => {
446
+ (0, vitest_1.describe)('is not app delegate', () => {
447
+ (0, vitest_1.it)('should be ignored', () => {
441
448
  // -- Arrange --
442
449
  const tempDir = prepareTempDir();
443
450
  prepareAppDelegateFile(tempDir, invalidAppDelegateSwift, 'swift');
444
451
  // -- Act --
445
452
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir);
446
453
  // -- Assert --
447
- expect(result).toBeNull();
454
+ (0, vitest_1.expect)(result).toBeNull();
448
455
  });
449
456
  });
450
457
  });
451
- describe('Objective-C file found', () => {
452
- describe('is app delegate', () => {
453
- it('should return the file path', () => {
458
+ (0, vitest_1.describe)('Objective-C file found', () => {
459
+ (0, vitest_1.describe)('is app delegate', () => {
460
+ (0, vitest_1.it)('should return the file path', () => {
454
461
  // -- Arrange --
455
462
  const tempDir = prepareTempDir();
456
463
  const filePath = prepareAppDelegateFile(tempDir, validAppDelegateObjC, 'm');
457
464
  // -- Act --
458
465
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir);
459
466
  // -- Assert --
460
- expect(result).toBe(filePath);
467
+ (0, vitest_1.expect)(result).toBe(filePath);
461
468
  });
462
469
  });
463
- describe('is not app delegate', () => {
464
- it('should be ignored', () => {
470
+ (0, vitest_1.describe)('is not app delegate', () => {
471
+ (0, vitest_1.it)('should be ignored', () => {
465
472
  // -- Arrange --
466
473
  const tempDir = prepareTempDir();
467
474
  prepareAppDelegateFile(tempDir, invalidAppDelegateObjC, 'm');
468
475
  // -- Act --
469
476
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir);
470
477
  // -- Assert --
471
- expect(result).toBeNull();
478
+ (0, vitest_1.expect)(result).toBeNull();
472
479
  });
473
480
  });
474
481
  });
475
- describe('Objective-C++ file found', () => {
476
- describe('is app delegate', () => {
477
- it('should return the file path', () => {
482
+ (0, vitest_1.describe)('Objective-C++ file found', () => {
483
+ (0, vitest_1.describe)('is app delegate', () => {
484
+ (0, vitest_1.it)('should return the file path', () => {
478
485
  // -- Arrange --
479
486
  const tempDir = prepareTempDir();
480
487
  const filePath = prepareAppDelegateFile(tempDir, validAppDelegateObjC, 'mm');
481
488
  // -- Act --
482
489
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir, [filePath]);
483
490
  // -- Assert --
484
- expect(result).toBe(filePath);
491
+ (0, vitest_1.expect)(result).toBe(filePath);
485
492
  });
486
493
  });
487
- describe('is not app delegate', () => {
488
- it('should be ignored', () => {
494
+ (0, vitest_1.describe)('is not app delegate', () => {
495
+ (0, vitest_1.it)('should be ignored', () => {
489
496
  // -- Arrange --
490
497
  const tempDir = prepareTempDir();
491
498
  prepareAppDelegateFile(tempDir, invalidAppDelegateObjC, 'mm');
492
499
  // -- Act --
493
500
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir);
494
501
  // -- Assert --
495
- expect(result).toBeNull();
502
+ (0, vitest_1.expect)(result).toBeNull();
496
503
  });
497
504
  });
498
505
  });
499
- describe('file in list not found', () => {
500
- it('should return null', () => {
506
+ (0, vitest_1.describe)('file in list not found', () => {
507
+ (0, vitest_1.it)('should return null', () => {
501
508
  // -- Arrange --
502
509
  const tempDir = prepareTempDir();
503
510
  const filePath = prepareAppDelegateFile(tempDir, invalidAppDelegateSwift, 'swift');
504
511
  // -- Act --
505
512
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir, [filePath]);
506
513
  // -- Assert --
507
- expect(result).toBeNull();
514
+ (0, vitest_1.expect)(result).toBeNull();
508
515
  });
509
516
  });
510
- describe('unrelated file found', () => {
511
- it('should be ignored', () => {
517
+ (0, vitest_1.describe)('unrelated file found', () => {
518
+ (0, vitest_1.it)('should be ignored', () => {
512
519
  // -- Arrange --
513
520
  const tempDir = prepareTempDir();
514
521
  const filePath = prepareAppDelegateFile(tempDir, invalidAppDelegateSwift, 'swift');
515
522
  // -- Act --
516
523
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir, [filePath]);
517
524
  // -- Assert --
518
- expect(result).toBeNull();
525
+ (0, vitest_1.expect)(result).toBeNull();
519
526
  });
520
527
  });
521
- describe('directory in list', () => {
522
- describe('name starts with dot', () => {
523
- it('should be ignored', () => {
528
+ (0, vitest_1.describe)('directory in list', () => {
529
+ (0, vitest_1.describe)('name starts with dot', () => {
530
+ (0, vitest_1.it)('should be ignored', () => {
524
531
  // -- Arrange --
525
532
  const tempDir = prepareTempDir();
526
533
  const hiddenDir = path.join(tempDir, '.hidden');
@@ -529,11 +536,11 @@ describe('code-tools', () => {
529
536
  // -- Act --
530
537
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir);
531
538
  // -- Assert --
532
- expect(result).toBeNull();
539
+ (0, vitest_1.expect)(result).toBeNull();
533
540
  });
534
541
  });
535
- describe('name ends with .xcodeproj', () => {
536
- it('should be ignored', () => {
542
+ (0, vitest_1.describe)('name ends with .xcodeproj', () => {
543
+ (0, vitest_1.it)('should be ignored', () => {
537
544
  // -- Arrange --
538
545
  const tempDir = prepareTempDir();
539
546
  const xcodeDir = path.join(tempDir, 'MyProject.xcodeproj');
@@ -542,11 +549,11 @@ describe('code-tools', () => {
542
549
  // -- Act --
543
550
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir);
544
551
  // -- Assert --
545
- expect(result).toBeNull();
552
+ (0, vitest_1.expect)(result).toBeNull();
546
553
  });
547
554
  });
548
- describe('name ends with .xcassets', () => {
549
- it('should be ignored', () => {
555
+ (0, vitest_1.describe)('name ends with .xcassets', () => {
556
+ (0, vitest_1.it)('should be ignored', () => {
550
557
  // -- Arrange --
551
558
  const tempDir = prepareTempDir();
552
559
  const xcassetsDir = path.join(tempDir, 'MyProject.xcassets');
@@ -555,11 +562,11 @@ describe('code-tools', () => {
555
562
  // -- Act --
556
563
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir);
557
564
  // -- Assert --
558
- expect(result).toBeNull();
565
+ (0, vitest_1.expect)(result).toBeNull();
559
566
  });
560
567
  });
561
- describe('is not a directory', () => {
562
- it('should be ignored', () => {
568
+ (0, vitest_1.describe)('is not a directory', () => {
569
+ (0, vitest_1.it)('should be ignored', () => {
563
570
  // -- Arrange --
564
571
  const tempDir = prepareTempDir();
565
572
  const filePath = path.join(tempDir, 'some-file');
@@ -567,12 +574,12 @@ describe('code-tools', () => {
567
574
  // -- Act --
568
575
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir);
569
576
  // -- Assert --
570
- expect(result).toBeNull();
577
+ (0, vitest_1.expect)(result).toBeNull();
571
578
  });
572
579
  });
573
580
  });
574
- describe('multiple files could be app delegate', () => {
575
- it('should return the first one', () => {
581
+ (0, vitest_1.describe)('multiple files could be app delegate', () => {
582
+ (0, vitest_1.it)('should return the first one', () => {
576
583
  // -- Arrange --
577
584
  const tempDir = prepareTempDir();
578
585
  const filePath = prepareAppDelegateFile(tempDir, validAppDelegateSwift, 'swift');
@@ -580,11 +587,11 @@ describe('code-tools', () => {
580
587
  // -- Act --
581
588
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir);
582
589
  // -- Assert --
583
- expect(result).toBe(filePath);
590
+ (0, vitest_1.expect)(result).toBe(filePath);
584
591
  });
585
592
  });
586
- describe('multiple nested directories with app delegate', () => {
587
- it('should return the first one', () => {
593
+ (0, vitest_1.describe)('multiple nested directories with app delegate', () => {
594
+ (0, vitest_1.it)('should return the first one', () => {
588
595
  // -- Arrange --
589
596
  const tempDir = prepareTempDir();
590
597
  const nestedDir = path.join(tempDir, 'nested');
@@ -596,187 +603,187 @@ describe('code-tools', () => {
596
603
  // -- Act --
597
604
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir);
598
605
  // -- Assert --
599
- expect(result).toBe(nestedFilePath);
606
+ (0, vitest_1.expect)(result).toBe(nestedFilePath);
600
607
  });
601
608
  });
602
- describe('no app delegate found', () => {
603
- it('should return null', () => {
609
+ (0, vitest_1.describe)('no app delegate found', () => {
610
+ (0, vitest_1.it)('should return null', () => {
604
611
  // -- Arrange --
605
612
  const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'code-tools-test'));
606
613
  // -- Act --
607
614
  const result = code_tools_1.exportForTesting.findAppDidFinishLaunchingWithOptions(tempDir, []);
608
615
  // -- Assert --
609
- expect(result).toBeNull();
616
+ (0, vitest_1.expect)(result).toBeNull();
610
617
  });
611
618
  });
612
619
  });
613
- describe('#addCodeSnippetToProject', () => {
614
- describe('app delegate file is not found', () => {
615
- it('should return false', () => {
620
+ (0, vitest_1.describe)('#addCodeSnippetToProject', () => {
621
+ (0, vitest_1.describe)('app delegate file is not found', () => {
622
+ (0, vitest_1.it)('should return false', () => {
616
623
  // -- Arrange --
617
624
  const tempDir = prepareTempDir();
618
625
  // -- Act --
619
626
  const result = (0, code_tools_1.addCodeSnippetToProject)(tempDir, ['AppDelegate.swift'], 'https://example.com/sentry-dsn');
620
627
  // -- Assert --
621
- expect(result).toBeFalsy();
628
+ (0, vitest_1.expect)(result).toBeFalsy();
622
629
  });
623
630
  });
624
- describe('app delegate file is found', () => {
631
+ (0, vitest_1.describe)('app delegate file is found', () => {
625
632
  let tempDir;
626
633
  let appDelegatePath;
627
- beforeEach(() => {
634
+ (0, vitest_1.beforeEach)(() => {
628
635
  // -- Arrange --
629
636
  tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'code-tools-test'));
630
637
  appDelegatePath = path.join(tempDir, 'AppDelegate.swift');
631
638
  fs.writeFileSync(appDelegatePath, validAppDelegateSwift, 'utf8');
632
639
  });
633
- describe('is Swift file', () => {
634
- describe('Sentry is not initialized', () => {
640
+ (0, vitest_1.describe)('is Swift file', () => {
641
+ (0, vitest_1.describe)('Sentry is not initialized', () => {
635
642
  let tempDir;
636
643
  let filePath;
637
- beforeEach(() => {
644
+ (0, vitest_1.beforeEach)(() => {
638
645
  tempDir = prepareTempDir();
639
646
  filePath = prepareAppDelegateFile(tempDir, validAppDelegateSwift, 'swift');
640
647
  });
641
- it('should add the code snippet', () => {
648
+ (0, vitest_1.it)('should add the code snippet', () => {
642
649
  // -- Act --
643
650
  const result = (0, code_tools_1.addCodeSnippetToProject)(tempDir, [filePath], dsn);
644
651
  // -- Assert --
645
- expect(result).toBeTruthy();
652
+ (0, vitest_1.expect)(result).toBeTruthy();
646
653
  const modifiedFileContent = fs.readFileSync(filePath, 'utf8');
647
- expect(modifiedFileContent).toBe(validAppDelegateSwiftWithSentry);
654
+ (0, vitest_1.expect)(modifiedFileContent).toBe(validAppDelegateSwiftWithSentry);
648
655
  });
649
- it("should set tag 'code-language'", () => {
656
+ (0, vitest_1.it)("should set tag 'code-language'", () => {
650
657
  // -- Act --
651
658
  const result = (0, code_tools_1.addCodeSnippetToProject)(tempDir, [filePath], dsn);
652
659
  // -- Assert --
653
- expect(result).toBeTruthy();
654
- expect(Sentry.setTag).toHaveBeenCalledWith('code-language', 'swift');
660
+ (0, vitest_1.expect)(result).toBeTruthy();
661
+ (0, vitest_1.expect)(Sentry.setTag).toHaveBeenCalledWith('code-language', 'swift');
655
662
  });
656
- it("should set tag 'ui-engine'", () => {
663
+ (0, vitest_1.it)("should set tag 'ui-engine'", () => {
657
664
  // -- Act --
658
665
  const result = (0, code_tools_1.addCodeSnippetToProject)(tempDir, [filePath], dsn);
659
666
  // -- Assert --
660
- expect(result).toBeTruthy();
661
- expect(Sentry.setTag).toHaveBeenCalledWith('ui-engine', 'uikit');
667
+ (0, vitest_1.expect)(result).toBeTruthy();
668
+ (0, vitest_1.expect)(Sentry.setTag).toHaveBeenCalledWith('ui-engine', 'uikit');
662
669
  });
663
670
  });
664
- describe('Sentry is already initialized', () => {
665
- it('should not add the code snippet', () => {
671
+ (0, vitest_1.describe)('Sentry is already initialized', () => {
672
+ (0, vitest_1.it)('should not add the code snippet', () => {
666
673
  // -- Arrange --
667
674
  const tempDir = prepareTempDir();
668
675
  const filePath = prepareAppDelegateFile(tempDir, validAppDelegateSwiftWithSentry, 'swift');
669
676
  // -- Act --
670
677
  const result = (0, code_tools_1.addCodeSnippetToProject)(tempDir, [filePath], dsn);
671
678
  // -- Assert --
672
- expect(result).toBeTruthy();
679
+ (0, vitest_1.expect)(result).toBeTruthy();
673
680
  const modifiedFileContent = fs.readFileSync(filePath, 'utf8');
674
- expect(modifiedFileContent).toBe(validAppDelegateSwiftWithSentry);
681
+ (0, vitest_1.expect)(modifiedFileContent).toBe(validAppDelegateSwiftWithSentry);
675
682
  });
676
683
  });
677
- describe('is SwiftUI file', () => {
678
- describe('Sentry is not initialized', () => {
684
+ (0, vitest_1.describe)('is SwiftUI file', () => {
685
+ (0, vitest_1.describe)('Sentry is not initialized', () => {
679
686
  let tempDir;
680
687
  let filePath;
681
- beforeEach(() => {
688
+ (0, vitest_1.beforeEach)(() => {
682
689
  tempDir = prepareTempDir();
683
690
  filePath = prepareAppDelegateFile(tempDir, validAppDelegateSwiftUI, 'swift');
684
691
  });
685
- it('should add the code snippet', () => {
692
+ (0, vitest_1.it)('should add the code snippet', () => {
686
693
  // -- Act --
687
694
  const result = (0, code_tools_1.addCodeSnippetToProject)(tempDir, [filePath], dsn);
688
695
  // -- Assert --
689
- expect(result).toBeTruthy();
696
+ (0, vitest_1.expect)(result).toBeTruthy();
690
697
  const modifiedFileContent = fs.readFileSync(filePath, 'utf8');
691
- expect(modifiedFileContent).toBe(validAppDelegateSwiftUIWithSentry);
698
+ (0, vitest_1.expect)(modifiedFileContent).toBe(validAppDelegateSwiftUIWithSentry);
692
699
  });
693
- it("should set tag 'code-language'", () => {
700
+ (0, vitest_1.it)("should set tag 'code-language'", () => {
694
701
  // -- Act --
695
702
  const result = (0, code_tools_1.addCodeSnippetToProject)(tempDir, [filePath], dsn);
696
703
  // -- Assert --
697
- expect(result).toBeTruthy();
698
- expect(Sentry.setTag).toHaveBeenNthCalledWith(1, 'code-language', 'swift');
704
+ (0, vitest_1.expect)(result).toBeTruthy();
705
+ (0, vitest_1.expect)(Sentry.setTag).toHaveBeenNthCalledWith(1, 'code-language', 'swift');
699
706
  });
700
- it("should set tag 'ui-engine'", () => {
707
+ (0, vitest_1.it)("should set tag 'ui-engine'", () => {
701
708
  // -- Act --
702
709
  const result = (0, code_tools_1.addCodeSnippetToProject)(tempDir, [filePath], dsn);
703
710
  // -- Assert --
704
- expect(result).toBeTruthy();
705
- expect(Sentry.setTag).toHaveBeenNthCalledWith(2, 'ui-engine', 'swiftui');
711
+ (0, vitest_1.expect)(result).toBeTruthy();
712
+ (0, vitest_1.expect)(Sentry.setTag).toHaveBeenNthCalledWith(2, 'ui-engine', 'swiftui');
706
713
  });
707
714
  });
708
- describe('Sentry is already initialized', () => {
709
- it('should not add the code snippet', () => {
715
+ (0, vitest_1.describe)('Sentry is already initialized', () => {
716
+ (0, vitest_1.it)('should not add the code snippet', () => {
710
717
  // -- Arrange --
711
718
  const tempDir = prepareTempDir();
712
719
  const filePath = prepareAppDelegateFile(tempDir, validAppDelegateSwiftUIWithSentry, 'swift');
713
720
  // -- Act --
714
721
  const result = (0, code_tools_1.addCodeSnippetToProject)(tempDir, [filePath], dsn);
715
722
  // -- Assert --
716
- expect(result).toBeTruthy();
723
+ (0, vitest_1.expect)(result).toBeTruthy();
717
724
  const modifiedFileContent = fs.readFileSync(filePath, 'utf8');
718
- expect(modifiedFileContent).toBe(validAppDelegateSwiftUIWithSentry);
725
+ (0, vitest_1.expect)(modifiedFileContent).toBe(validAppDelegateSwiftUIWithSentry);
719
726
  });
720
727
  });
721
728
  });
722
- describe('is not matching SwiftUI regex', () => {
723
- it('should not add the code snippet', () => {
729
+ (0, vitest_1.describe)('is not matching SwiftUI regex', () => {
730
+ (0, vitest_1.it)('should not add the code snippet', () => {
724
731
  // -- Arrange --
725
732
  const tempDir = prepareTempDir();
726
733
  const filePath = prepareAppDelegateFile(tempDir, invalidAppDelegateSwiftUI, 'swift');
727
734
  // -- Act --
728
735
  const result = (0, code_tools_1.addCodeSnippetToProject)(tempDir, [filePath], dsn);
729
736
  // -- Assert --
730
- expect(result).toBeFalsy();
737
+ (0, vitest_1.expect)(result).toBeFalsy();
731
738
  });
732
739
  });
733
740
  });
734
- describe('is Objective-C file', () => {
735
- describe('Sentry is not initialized', () => {
736
- it('should add the code snippet', () => {
741
+ (0, vitest_1.describe)('is Objective-C file', () => {
742
+ (0, vitest_1.describe)('Sentry is not initialized', () => {
743
+ (0, vitest_1.it)('should add the code snippet', () => {
737
744
  // -- Act --
738
745
  const tempDir = prepareTempDir();
739
746
  const filePath = prepareAppDelegateFile(tempDir, validAppDelegateObjC, 'm');
740
747
  // -- Act --
741
748
  const result = (0, code_tools_1.addCodeSnippetToProject)(tempDir, [filePath], dsn);
742
749
  // -- Assert --
743
- expect(result).toBeTruthy();
750
+ (0, vitest_1.expect)(result).toBeTruthy();
744
751
  const modifiedFileContent = fs.readFileSync(filePath, 'utf8');
745
- expect(modifiedFileContent).toBe(validAppDelegateObjCWithSentry);
752
+ (0, vitest_1.expect)(modifiedFileContent).toBe(validAppDelegateObjCWithSentry);
746
753
  });
747
754
  });
748
- describe('Sentry is already initialized', () => {
755
+ (0, vitest_1.describe)('Sentry is already initialized', () => {
749
756
  let tempDir;
750
757
  let filePath;
751
- beforeEach(() => {
758
+ (0, vitest_1.beforeEach)(() => {
752
759
  tempDir = prepareTempDir();
753
760
  filePath = prepareAppDelegateFile(tempDir, validAppDelegateObjCWithSentry, 'm');
754
761
  });
755
- it('should not add the code snippet', () => {
762
+ (0, vitest_1.it)('should not add the code snippet', () => {
756
763
  // -- Act --
757
764
  const result = (0, code_tools_1.addCodeSnippetToProject)(tempDir, [filePath], dsn);
758
765
  // -- Assert --
759
- expect(result).toBeTruthy();
766
+ (0, vitest_1.expect)(result).toBeTruthy();
760
767
  const modifiedFileContent = fs.readFileSync(filePath, 'utf8');
761
- expect(modifiedFileContent).toBe(validAppDelegateObjCWithSentry);
768
+ (0, vitest_1.expect)(modifiedFileContent).toBe(validAppDelegateObjCWithSentry);
762
769
  });
763
- it('should log info', () => {
770
+ (0, vitest_1.it)('should log info', () => {
764
771
  // -- Act --
765
772
  const result = (0, code_tools_1.addCodeSnippetToProject)(tempDir, [filePath], dsn);
766
773
  // -- Assert --
767
- expect(result).toBeTruthy();
768
- expect(clack.log.info).toHaveBeenCalledWith('Sentry is already initialized in your AppDelegate. Skipping adding the code snippet.');
774
+ (0, vitest_1.expect)(result).toBeTruthy();
775
+ (0, vitest_1.expect)(clack.log.info).toHaveBeenCalledWith('Sentry is already initialized in your AppDelegate. Skipping adding the code snippet.');
769
776
  });
770
777
  });
771
- it("should set tag 'code-language'", () => {
778
+ (0, vitest_1.it)("should set tag 'code-language'", () => {
772
779
  // -- Arrange --
773
780
  const tempDir = prepareTempDir();
774
781
  const filePath = prepareAppDelegateFile(tempDir, validAppDelegateObjC, 'm');
775
782
  // -- Act --
776
783
  const result = (0, code_tools_1.addCodeSnippetToProject)(tempDir, [filePath], dsn);
777
784
  // -- Assert --
778
- expect(result).toBeTruthy();
779
- expect(Sentry.setTag).toHaveBeenCalledWith('code-language', 'objc');
785
+ (0, vitest_1.expect)(result).toBeTruthy();
786
+ (0, vitest_1.expect)(Sentry.setTag).toHaveBeenCalledWith('code-language', 'objc');
780
787
  });
781
788
  });
782
789
  });