@sentry/wizard 6.7.0 → 6.8.1
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 +16 -3
- package/dist/e2e-tests/tests/pnpm-workspace.test.d.ts +1 -0
- package/dist/e2e-tests/tests/pnpm-workspace.test.js +206 -0
- package/dist/e2e-tests/tests/pnpm-workspace.test.js.map +1 -0
- package/dist/e2e-tests/tests/sveltekit-hooks.test.js +70 -84
- package/dist/e2e-tests/tests/sveltekit-hooks.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit-tracing.test.js +3 -0
- package/dist/e2e-tests/tests/sveltekit-tracing.test.js.map +1 -1
- package/dist/src/apple/fastlane.js +3 -1
- package/dist/src/apple/fastlane.js.map +1 -1
- package/dist/src/apple/templates.js +1 -1
- package/dist/src/apple/templates.js.map +1 -1
- package/dist/src/sveltekit/sdk-example.d.ts +1 -0
- package/dist/src/sveltekit/sdk-example.js +3 -1
- package/dist/src/sveltekit/sdk-example.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +4 -2
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/src/sveltekit/templates.d.ts +1 -0
- package/dist/src/sveltekit/templates.js +2 -4
- package/dist/src/sveltekit/templates.js.map +1 -1
- package/dist/src/sveltekit/utils.d.ts +1 -1
- package/dist/src/sveltekit/utils.js +45 -32
- package/dist/src/sveltekit/utils.js.map +1 -1
- package/dist/src/utils/package-json.js +86 -2
- package/dist/src/utils/package-json.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/apple/fastfile.test.js +8 -8
- package/dist/test/apple/fastfile.test.js.map +1 -1
- package/dist/test/apple/templates.test.js +1 -1
- package/dist/test/apple/templates.test.js.map +1 -1
- package/dist/test/sveltekit/templates.test.js +478 -0
- package/dist/test/sveltekit/templates.test.js.map +1 -1
- package/dist/test/sveltekit/utils.test.d.ts +1 -0
- package/dist/test/sveltekit/utils.test.js +68 -0
- package/dist/test/sveltekit/utils.test.js.map +1 -0
- package/dist/test/utils/package-json.test.d.ts +1 -0
- package/dist/test/utils/package-json.test.js +428 -0
- package/dist/test/utils/package-json.test.js.map +1 -0
- package/package.json +3 -1
|
@@ -248,7 +248,7 @@ end
|
|
|
248
248
|
});
|
|
249
249
|
});
|
|
250
250
|
(0, vitest_1.describe)('#addSentryToLane', () => {
|
|
251
|
-
(0, vitest_1.describe)('
|
|
251
|
+
(0, vitest_1.describe)('sentry_debug_files_upload is not present', () => {
|
|
252
252
|
(0, vitest_1.it)('should return original content', () => {
|
|
253
253
|
// -- Arrange --
|
|
254
254
|
const content = `
|
|
@@ -267,7 +267,7 @@ platform :ios do
|
|
|
267
267
|
lane :test do
|
|
268
268
|
puts 'Hello, world!'
|
|
269
269
|
|
|
270
|
-
|
|
270
|
+
sentry_debug_files_upload(
|
|
271
271
|
org_slug: 'test-org',
|
|
272
272
|
project_slug: 'test-project',
|
|
273
273
|
include_sources: true
|
|
@@ -277,7 +277,7 @@ end
|
|
|
277
277
|
`);
|
|
278
278
|
});
|
|
279
279
|
});
|
|
280
|
-
(0, vitest_1.describe)('
|
|
280
|
+
(0, vitest_1.describe)('sentry_debug_files_upload is present', () => {
|
|
281
281
|
(0, vitest_1.it)('should return updated content', () => {
|
|
282
282
|
// -- Arrange --
|
|
283
283
|
const content = `
|
|
@@ -285,11 +285,11 @@ platform :ios do
|
|
|
285
285
|
lane :test do
|
|
286
286
|
puts 'Hello, world!'
|
|
287
287
|
|
|
288
|
-
|
|
288
|
+
sentry_debug_files_upload(org_slug: 'test-org', project_slug: 'test-project')
|
|
289
289
|
end
|
|
290
290
|
end
|
|
291
291
|
`;
|
|
292
|
-
const lane = { index: 34, length:
|
|
292
|
+
const lane = { index: 34, length: 108, name: 'test' };
|
|
293
293
|
// -- Act --
|
|
294
294
|
const result = fastlane_1.exportForTesting.addSentryToLane(content, lane, 'test-org', 'test-project');
|
|
295
295
|
// -- Assert --
|
|
@@ -298,7 +298,7 @@ platform :ios do
|
|
|
298
298
|
lane :test do
|
|
299
299
|
puts 'Hello, world!'
|
|
300
300
|
|
|
301
|
-
|
|
301
|
+
sentry_debug_files_upload(
|
|
302
302
|
org_slug: 'test-org',
|
|
303
303
|
project_slug: 'test-project',
|
|
304
304
|
include_sources: true
|
|
@@ -385,7 +385,7 @@ platform :ios do
|
|
|
385
385
|
lane :test do
|
|
386
386
|
puts 'Hello, world!'
|
|
387
387
|
|
|
388
|
-
|
|
388
|
+
sentry_debug_files_upload(
|
|
389
389
|
org_slug: 'test-org',
|
|
390
390
|
project_slug: 'test-project',
|
|
391
391
|
include_sources: true
|
|
@@ -444,7 +444,7 @@ end
|
|
|
444
444
|
lane :beta do
|
|
445
445
|
puts 'Beta lane'
|
|
446
446
|
|
|
447
|
-
|
|
447
|
+
sentry_debug_files_upload(
|
|
448
448
|
org_slug: 'test-org',
|
|
449
449
|
project_slug: 'test-project',
|
|
450
450
|
include_sources: true
|
|
@@ -1 +1 @@
|
|
|
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,+EAA+E;AAC/E,sDAAwC;AACxC,mCAA8D;AAE9D,WAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IACrC,UAAU,EAAE,IAAI;IAChB,GAAG,CAAC,MAAM,WAAE,CAAC,YAAY,CAAe,gBAAgB,CAAC,CAAC;CAC3D,CAAC,CAAC,CAAC;AAEJ,IAAA,iBAAQ,EAAC,UAAU,EAAE,GAAG,EAAE;IACxB,IAAA,mBAAU,EAAC,GAAG,EAAE;QACd,WAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,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W,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;IAC3E,MAAM,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,EAAE,WAAW,EAAE,CAAC;AACtC,CAAC;AAED,SAAS,cAAc,CAAC,WAAmB,EAAE,OAAe;IAC1D,MAAM,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 '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-expect-error - clack is ESM and TS complains about that. It works though\nimport * as clack from '@clack/prompts';\nimport { beforeEach, describe, expect, it, vi } from 'vitest';\n\nvi.mock('@clack/prompts', async () => ({\n __esModule: true,\n ...(await vi.importActual<typeof clack>('@clack/prompts')),\n}));\n\ndescribe('fastlane', () => {\n beforeEach(() => {\n vi.spyOn(clack.log, 'warn').mockImplementation(() => {\n /* empty */\n });\n vi.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 vi.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 vi.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,+EAA+E;AAC/E,sDAAwC;AACxC,mCAA8D;AAE9D,WAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IACrC,UAAU,EAAE,IAAI;IAChB,GAAG,CAAC,MAAM,WAAE,CAAC,YAAY,CAAe,gBAAgB,CAAC,CAAC;CAC3D,CAAC,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ACF,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,SAAS,iBAAiB;IACxB,MAAM,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;IAC3E,MAAM,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,EAAE,WAAW,EAAE,CAAC;AACtC,CAAC;AAED,SAAS,cAAc,CAAC,WAAmB,EAAE,OAAe;IAC1D,MAAM,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 '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-expect-error - clack is ESM and TS complains about that. It works though\nimport * as clack from '@clack/prompts';\nimport { beforeEach, describe, expect, it, vi } from 'vitest';\n\nvi.mock('@clack/prompts', async () => ({\n __esModule: true,\n ...(await vi.importActual<typeof clack>('@clack/prompts')),\n}));\n\ndescribe('fastlane', () => {\n beforeEach(() => {\n vi.spyOn(clack.log, 'warn').mockImplementation(() => {\n /* empty */\n });\n vi.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_debug_files_upload 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_debug_files_upload(\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_debug_files_upload 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_debug_files_upload(org_slug: 'test-org', project_slug: 'test-project')\n end\nend\n`;\n const lane = { index: 34, length: 108, 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_debug_files_upload(\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_debug_files_upload(\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 vi.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 vi.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_debug_files_upload(\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"]}
|
|
@@ -228,7 +228,7 @@ fi
|
|
|
228
228
|
// -- Arrange --
|
|
229
229
|
const snippet = (0, templates_1.getFastlaneSnippet)('test-org', 'test-project');
|
|
230
230
|
// -- Assert --
|
|
231
|
-
(0, vitest_1.expect)(snippet).toBe(`
|
|
231
|
+
(0, vitest_1.expect)(snippet).toBe(` sentry_debug_files_upload(
|
|
232
232
|
org_slug: 'test-org',
|
|
233
233
|
project_slug: 'test-project',
|
|
234
234
|
include_sources: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/apple/templates.test.ts"],"names":[],"mappings":";;AAAA,mCAAkD;AAClD,yDAMmC;AAEnC,WAAE,CAAC,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,CAAC;IACjD,2BAA2B,EAAE,WAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC;CAClE,CAAC,CAAC,CAAC;AAEJ,IAAA,iBAAQ,EAAC,WAAW,EAAE,GAAG,EAAE;IACzB,IAAA,iBAAQ,EAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,MAAM,UAAU,GAIV;YACJ;gBACE,YAAY,EAAE,IAAI;gBAClB,mBAAmB,EAAE,IAAI;gBACzB,cAAc,EAAE;;;;;;;;;;;;;;;CAevB;aACM;YACD;gBACE,YAAY,EAAE,IAAI;gBAClB,mBAAmB,EAAE,KAAK;gBAC1B,cAAc,EAAE;;;;;;;;;;;CAWvB;aACM;YACD;gBACE,YAAY,EAAE,KAAK;gBACnB,mBAAmB,EAAE,IAAI;gBACzB,cAAc,EAAE;;;;;;;;;;;;;;;CAevB;aACM;YACD;gBACE,YAAY,EAAE,KAAK;gBACnB,mBAAmB,EAAE,KAAK;gBAC1B,cAAc,EAAE;;;;;;;;;;;CAWvB;aACM;SACF,CAAC;QAEF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;YAClC,IAAA,iBAAQ,EAAC,iBAAiB,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,6BAA6B,SAAS,CAAC,mBAAmB,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE;gBACvI,IAAA,WAAE,EAAC,kCAAkC,EAAE,GAAG,EAAE;oBAC1C,WAAW;oBACX,MAAM,MAAM,GA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G,EAAE;YAC3C,gBAAgB;YAChB,MAAM,OAAO,GAAG,IAAA,0BAAc,EAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YAElD,eAAe;YACf,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,IAAI,CAClB;;;;;;;;;;;;;;;;;;;;;;;CAuBP,CACM,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,IAAA,WAAE,EAAC,qDAAqD,EAAE,GAAG,EAAE;YAC7D,gBAAgB;YAChB,MAAM,OAAO,GAAG,IAAA,0BAAc,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;YAEjD,eAAe;YACf,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,IAAI,CAClB;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BP,CACM,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,iBAAQ,EAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,IAAA,WAAE,EAAC,mCAAmC,EAAE,GAAG,EAAE;YAC3C,gBAAgB;YAChB,MAAM,OAAO,GAAG,IAAA,8BAAkB,EAAC,UAAU,EAAE,cAAc,CAAC,CAAC;YAE/D,eAAe;YACf,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,IAAI,CAClB;;;;MAIF,CACC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, expect, it, vi } from 'vitest';\nimport {\n getFastlaneSnippet,\n getObjcSnippet,\n getRunScriptTemplate,\n getSwiftSnippet,\n scriptInputPath,\n} from '../../src/apple/templates';\n\nvi.mock('../../src/utils/clack/mcp-config', () => ({\n offerProjectScopedMcpConfig: vi.fn().mockResolvedValue(undefined),\n}));\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: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload --include-sources \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`,\n },\n {\n uploadSource: true,\n includeHomebrewPath: false,\n expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload --include-sources \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`,\n },\n {\n uploadSource: false,\n includeHomebrewPath: true,\n expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`,\n },\n {\n uploadSource: false,\n includeHomebrewPath: false,\n expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\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', false);\n\n // -- Assert --\n expect(snippet).toBe(\n ` SentrySDK.start { options in\n options.dsn = \"test-dsn\"\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = true\n\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 it('should return the correct snippet with logs enabled', () => {\n // -- Arrange --\n const snippet = getSwiftSnippet('test-dsn', true);\n\n // -- Assert --\n expect(snippet).toBe(\n ` SentrySDK.start { options in\n options.dsn = \"test-dsn\"\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = true\n\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 // Enable experimental logging features\n options.experimental.enableLogs = true\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', false);\n\n // -- Assert --\n expect(snippet).toBe(\n ` [SentrySDK startWithConfigureOptions:^(SentryOptions * options) {\n options.dsn = @\"test-dsn\";\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = YES;\n\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 it('should return the correct snippet with logs enabled', () => {\n // -- Arrange --\n const snippet = getObjcSnippet('test-dsn', true);\n\n // -- Assert --\n expect(snippet).toBe(\n ` [SentrySDK startWithConfigureOptions:^(SentryOptions * options) {\n options.dsn = @\"test-dsn\";\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = YES;\n\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 // Enable experimental logging features\n options.experimental.enableLogs = YES;\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"]}
|
|
1
|
+
{"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/apple/templates.test.ts"],"names":[],"mappings":";;AAAA,mCAAkD;AAClD,yDAMmC;AAEnC,WAAE,CAAC,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,CAAC;IACjD,2BAA2B,EAAE,WAAE,CAAC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,UAAU,EAAE,IAAI,CAAC,CAAC;YAEjD,eAAe;YACf,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,IAAI,CAClB;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BP,CACM,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,iBAAQ,EAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,IAAA,WAAE,EAAC,mCAAmC,EAAE,GAAG,EAAE;YAC3C,gBAAgB;YAChB,MAAM,OAAO,GAAG,IAAA,8BAAkB,EAAC,UAAU,EAAE,cAAc,CAAC,CAAC;YAE/D,eAAe;YACf,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,IAAI,CAClB;;;;MAIF,CACC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, expect, it, vi } from 'vitest';\nimport {\n getFastlaneSnippet,\n getObjcSnippet,\n getRunScriptTemplate,\n getSwiftSnippet,\n scriptInputPath,\n} from '../../src/apple/templates';\n\nvi.mock('../../src/utils/clack/mcp-config', () => ({\n offerProjectScopedMcpConfig: vi.fn().mockResolvedValue(undefined),\n}));\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: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload --include-sources \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`,\n },\n {\n uploadSource: true,\n includeHomebrewPath: false,\n expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload --include-sources \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`,\n },\n {\n uploadSource: false,\n includeHomebrewPath: true,\n expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`,\n },\n {\n uploadSource: false,\n includeHomebrewPath: false,\n expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\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', false);\n\n // -- Assert --\n expect(snippet).toBe(\n ` SentrySDK.start { options in\n options.dsn = \"test-dsn\"\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = true\n\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 it('should return the correct snippet with logs enabled', () => {\n // -- Arrange --\n const snippet = getSwiftSnippet('test-dsn', true);\n\n // -- Assert --\n expect(snippet).toBe(\n ` SentrySDK.start { options in\n options.dsn = \"test-dsn\"\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = true\n\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 // Enable experimental logging features\n options.experimental.enableLogs = true\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', false);\n\n // -- Assert --\n expect(snippet).toBe(\n ` [SentrySDK startWithConfigureOptions:^(SentryOptions * options) {\n options.dsn = @\"test-dsn\";\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = YES;\n\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 it('should return the correct snippet with logs enabled', () => {\n // -- Arrange --\n const snippet = getObjcSnippet('test-dsn', true);\n\n // -- Assert --\n expect(snippet).toBe(\n ` [SentrySDK startWithConfigureOptions:^(SentryOptions * options) {\n options.dsn = @\"test-dsn\";\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = YES;\n\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 // Enable experimental logging features\n options.experimental.enableLogs = YES;\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_debug_files_upload(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )`,\n );\n });\n });\n});\n"]}
|