@sentry/wizard 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -1
- package/dist/NextJs/configs/next.config.js +1 -1
- package/dist/bin.js +2 -1
- package/dist/bin.js.map +1 -1
- package/dist/bump-version.js +28 -0
- package/dist/craft-pre-release.sh +2 -0
- package/dist/lib/Steps/Initial.js +2 -12
- package/dist/lib/Steps/Initial.js.map +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +2 -2
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nextjs/templates.js +1 -1
- package/dist/src/nextjs/templates.js.map +1 -1
- package/dist/src/nuxt/sdk-setup.js +59 -14
- package/dist/src/nuxt/sdk-setup.js.map +1 -1
- package/dist/src/run.js +2 -18
- package/dist/src/run.js.map +1 -1
- package/dist/src/telemetry.js +2 -16
- package/dist/src/telemetry.js.map +1 -1
- package/dist/src/utils/clack-utils.d.ts +16 -0
- package/dist/src/utils/clack-utils.js +57 -46
- package/dist/src/utils/clack-utils.js.map +1 -1
- package/dist/src/version.d.ts +1 -0
- package/dist/src/version.js +7 -0
- package/dist/src/version.js.map +1 -0
- package/dist/test/apple/xcode-manager.test.js +1 -2
- package/dist/test/apple/xcode-manager.test.js.map +1 -1
- package/dist/test/nextjs/templates.test.js +4 -4
- package/dist/test/nextjs/templates.test.js.map +1 -1
- package/dist/test/utils/clack-utils.test.js +105 -0
- package/dist/test/utils/clack-utils.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xcode-manager.test.js","sourceRoot":"","sources":["../../../test/apple/xcode-manager.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,4CAA8B;AAC9B,gDAAkC;AASlC,yDAAiE;AACjE,iEAA6D;AAG7D,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GA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CAAC;oBAE7C,eAAe;oBACf,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;wBACpB;4BACE,GAAG,EAAE,cAAc;4BACnB,IAAI,EAAE,yBAAyB;yBAChC;qBACF,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,8CAA8C,EAAE,GAAG,EAAE;YAC5D,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;gBAC3B,gBAAgB;gBAChB,MAAM,YAAY,GAAG,IAAI,4BAAY,CAAC,uBAAuB,CAAC,CAAC;gBAC/D,YAAY,CAAC,OAAO,CAAC,QAAQ,GAAG,EAAE,CAAC;gBACnC,YAAY,CAAC,OAAO,CAAC,gBAAgB,GAAG,EAAE,CAAC;gBAC3C,MAAM,KAAK,GAAa;oBACtB,QAAQ,EAAE;wBACR;4BACE,KAAK,EAAE,YAAY;yBACpB;qBACF;oBACD,IAAI,EAAE,EAAE;iBACT,CAAC;gBAEF,YAAY;gBACZ,MAAM,KAAK,GAAG,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;gBAE7C,eAAe;gBACf,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC5B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport type {\n PBXFileReference,\n PBXGroup,\n PBXNativeTarget,\n PBXProject,\n PBXShellScriptBuildPhase,\n XCBuildConfiguration,\n} from 'xcode';\nimport { getRunScriptTemplate } from '../../src/apple/templates';\nimport { XcodeProject } from '../../src/apple/xcode-manager';\nimport type { SentryProjectData } from '../../src/utils/types';\n\njest.mock('node:fs', () => ({\n __esModule: true,\n ...jest.requireActual('node:fs'),\n}));\njest.mock('@clack/prompts', () => ({\n log: {\n info: jest.fn(),\n success: jest.fn(),\n step: jest.fn(),\n },\n}));\n\nconst appleProjectsPath = path.resolve(\n __dirname,\n '../../e2e-tests/test-applications/apple',\n);\nconst damagedProjectPath = path.join(\n appleProjectsPath,\n 'damaged-missing-configuration-list/Project.xcodeproj/project.pbxproj',\n);\nconst noTargetsProjectPath = path.join(\n appleProjectsPath,\n 'no-targets/Project.xcodeproj/project.pbxproj',\n);\nconst singleTargetProjectPath = path.join(\n appleProjectsPath,\n 'spm-swiftui-single-target/Project.xcodeproj/project.pbxproj',\n);\nconst multiTargetProjectPath = path.join(\n appleProjectsPath,\n 'spm-swiftui-multi-targets/Project.xcodeproj/project.pbxproj',\n);\nconst projectData: SentryProjectData = {\n id: '1234567890',\n slug: 'project',\n organization: {\n id: '1234567890',\n name: 'Sentry',\n slug: 'sentry',\n },\n keys: [{ dsn: { public: 'https://sentry.io/1234567890' } }],\n};\n\ndescribe('XcodeManager', () => {\n afterEach(() => {\n jest.clearAllMocks();\n });\n\n describe('XcodeProject', () => {\n describe('getAllTargets', () => {\n describe('single target', () => {\n it('should return all targets', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n\n // -- Act --\n const targets = xcodeProject.getAllTargets();\n\n // -- Assert --\n expect(targets).toEqual(['Project']);\n });\n });\n\n describe('multiple targets', () => {\n it('should return all targets', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(multiTargetProjectPath);\n\n // -- Act --\n const targets = xcodeProject.getAllTargets();\n\n // -- Assert --\n expect(targets).toEqual(['Project1', 'Project2']);\n });\n });\n\n describe('no targets', () => {\n it('should return an empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(noTargetsProjectPath);\n\n // -- Act --\n const targets = xcodeProject.getAllTargets();\n\n // -- Assert --\n expect(targets).toEqual([]);\n });\n });\n\n describe('project with missing configuration list', () => {\n it('should return an empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(damagedProjectPath);\n\n // -- Act --\n const targets = xcodeProject.getAllTargets();\n\n // -- Assert --\n expect(targets).toEqual([]);\n });\n });\n });\n\n describe('updateXcodeProject', () => {\n let sourceProjectPath: string;\n let tempProjectPath: string;\n let xcodeProject: XcodeProject;\n\n beforeEach(() => {\n const tempDir = path.join(\n os.tmpdir(),\n fs.mkdtempSync('update-xcode-project'),\n );\n fs.mkdirSync(tempDir);\n\n sourceProjectPath = singleTargetProjectPath;\n tempProjectPath = path.resolve(tempDir, 'project.pbxproj');\n\n fs.copyFileSync(sourceProjectPath, tempProjectPath);\n xcodeProject = new XcodeProject(tempProjectPath);\n });\n\n describe('upload symbols script', () => {\n const scriptVariants: {\n uploadSource: boolean;\n includeHomebrewPath: boolean;\n }[] = [\n {\n uploadSource: true,\n includeHomebrewPath: true,\n },\n {\n uploadSource: true,\n includeHomebrewPath: false,\n },\n {\n uploadSource: false,\n includeHomebrewPath: true,\n },\n {\n uploadSource: false,\n includeHomebrewPath: false,\n },\n ];\n\n for (const variant of scriptVariants) {\n describe(`upload source = ${variant.uploadSource?.toString()} and include homebrew path = ${variant.includeHomebrewPath.toString()}`, () => {\n beforeEach(() => {\n jest\n .spyOn(fs, 'existsSync')\n .mockReturnValue(variant.includeHomebrewPath);\n });\n\n afterEach(() => {\n jest.restoreAllMocks();\n });\n\n it('should add the upload symbols script to the target', () => {\n // -- Arrange --\n const generatedShellScript = getRunScriptTemplate(\n projectData.organization.slug,\n projectData.slug,\n variant.uploadSource,\n variant.includeHomebrewPath,\n );\n const expectedShellScript = `\"${generatedShellScript.replace(\n /\"/g,\n '\\\\\"',\n )}\"`;\n\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Project',\n false, // Ignore SPM reference\n variant.uploadSource,\n );\n\n // -- Assert --\n const updatedXcodeProject = new XcodeProject(tempProjectPath);\n\n // Expect the upload symbols script to be added\n const scriptObjects =\n updatedXcodeProject.objects.PBXShellScriptBuildPhase;\n expect(scriptObjects).toBeDefined();\n if (!scriptObjects) {\n throw new Error('Script objects not found');\n }\n const scriptKeys = Object.keys(scriptObjects);\n expect(scriptKeys).toHaveLength(2);\n\n // Find the script ID\n const scriptId = scriptKeys.find(\n (key) => !key.endsWith('_comment'),\n );\n expect(scriptId).toBeDefined();\n if (!scriptId) {\n throw new Error('Script ID not found');\n }\n expect(scriptId).toMatch(/^[A-F0-9]{24}$/i);\n\n // Expect the script to be added\n const script = scriptObjects[\n scriptId\n ] as PBXShellScriptBuildPhase;\n expect(script).toBeDefined();\n expect(typeof script).not.toBe('string');\n expect(script.inputPaths).toEqual([\n '\"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}\"',\n ]);\n expect(script.outputPaths).toEqual([]);\n expect(script.shellPath).toBe('/bin/sh');\n expect(script.shellScript).toEqual(expectedShellScript);\n\n const commentKey = `${scriptId}_comment`;\n expect(scriptKeys).toContain(commentKey);\n expect(scriptObjects[commentKey]).toBe(\n 'Upload Debug Symbols to Sentry',\n );\n });\n });\n }\n });\n\n describe('debug information format and sandbox', () => {\n describe('upload source is false', () => {\n it('should not update the Xcode project', () => {\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Project',\n false, // Ignore SPM reference\n false,\n );\n\n // -- Assert --\n const expectedXcodeProject = new XcodeProject(sourceProjectPath);\n expect(xcodeProject.objects.XCBuildConfiguration).toEqual(\n expectedXcodeProject.objects.XCBuildConfiguration,\n );\n });\n });\n\n describe('upload source is true', () => {\n const uploadSource = true;\n\n describe('named target not found', () => {\n it('should not update the flags in the Xcode project', () => {\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Invalid Target Name',\n false, // Ignore SPM reference\n uploadSource,\n );\n\n // -- Assert --\n const originalXcodeProject = new XcodeProject(sourceProjectPath);\n expect(xcodeProject.objects.XCBuildConfiguration).toEqual(\n originalXcodeProject.objects.XCBuildConfiguration,\n );\n });\n });\n\n describe('named target found', () => {\n describe('build configurations is undefined', () => {\n it('should not update the Xcode project', () => {\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Invalid Target Name',\n false, // Ignore SPM reference\n uploadSource,\n );\n\n // -- Assert --\n const originalXcodeProject = new XcodeProject(\n sourceProjectPath,\n );\n expect(xcodeProject.objects.XCBuildConfiguration).toEqual(\n originalXcodeProject.objects.XCBuildConfiguration,\n );\n });\n });\n\n describe('no build configurations found', () => {\n it('should not update the Xcode project', () => {\n // -- Arrange --\n xcodeProject.objects.XCBuildConfiguration = {};\n\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Invalid Target Name',\n false, // Ignore SPM reference\n uploadSource,\n );\n\n // -- Assert --\n expect(xcodeProject.objects.XCBuildConfiguration).toEqual({});\n });\n });\n\n describe('build configurations found', () => {\n const debugProjectBuildConfigurationListId =\n 'D4E604DA2D50CEEE00CAB00F';\n const releaseProjectBuildConfigurationListId =\n 'D4E604DB2D50CEEE00CAB00F';\n const debugTargetBuildConfigurationListId =\n 'D4E604DD2D50CEEE00CAB00F';\n const releaseTargetBuildConfigurationListId =\n 'D4E604DE2D50CEEE00CAB00F';\n\n it('should update the target configuration lists', () => {\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Project',\n false, // Ignore SPM reference\n uploadSource,\n );\n\n // -- Assert --\n expect(xcodeProject.objects.XCBuildConfiguration).toBeDefined();\n // Both Debug and Release are configured equally\n const expectedConfigKeys = [\n debugTargetBuildConfigurationListId, // Debug\n releaseTargetBuildConfigurationListId, // Release\n ];\n for (const key of expectedConfigKeys) {\n const buildConfiguration = xcodeProject.objects\n .XCBuildConfiguration?.[key] as XCBuildConfiguration;\n expect(buildConfiguration).toBeDefined();\n expect(typeof buildConfiguration).not.toBe('string');\n const buildSettings = buildConfiguration.buildSettings ?? {};\n expect(buildSettings.DEBUG_INFORMATION_FORMAT).toBe(\n '\"dwarf-with-dsym\"',\n );\n expect(buildSettings.ENABLE_USER_SCRIPT_SANDBOXING).toBe(\n '\"NO\"',\n );\n }\n });\n\n it('should not update the project configuration lists', () => {\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Project',\n false, // Ignore SPM reference\n uploadSource,\n );\n\n // -- Assert --\n expect(xcodeProject.objects.XCBuildConfiguration).toBeDefined();\n\n // Check project build configurations 'Debug'\n const debugBuildConfiguration = xcodeProject.objects\n .XCBuildConfiguration?.[\n debugProjectBuildConfigurationListId\n ] as XCBuildConfiguration;\n expect(debugBuildConfiguration).toBeDefined();\n expect(typeof debugBuildConfiguration).not.toBe('string');\n expect(\n debugBuildConfiguration.buildSettings\n ?.DEBUG_INFORMATION_FORMAT,\n ).toBe('dwarf');\n expect(\n debugBuildConfiguration.buildSettings\n ?.ENABLE_USER_SCRIPT_SANDBOXING,\n ).toBe('YES');\n\n // Check project build configurations 'Release'\n const releaseBuildConfiguration = xcodeProject.objects\n .XCBuildConfiguration?.[\n releaseProjectBuildConfigurationListId\n ] as XCBuildConfiguration;\n expect(releaseBuildConfiguration).toBeDefined();\n expect(typeof releaseBuildConfiguration).not.toBe('string');\n expect(\n releaseBuildConfiguration.buildSettings\n ?.DEBUG_INFORMATION_FORMAT,\n ).toBe('\"dwarf-with-dsym\"');\n expect(\n releaseBuildConfiguration.buildSettings\n ?.ENABLE_USER_SCRIPT_SANDBOXING,\n ).toBe('YES');\n });\n });\n });\n });\n });\n\n describe('add SPM reference', () => {\n const addSPMReference = true;\n\n describe('framework build phase already contains Sentry', () => {\n it('should not update the Xcode project', () => {\n // -- Arrange --\n xcodeProject.objects.PBXFrameworksBuildPhase = {\n 'framework-id': {\n files: [\n {\n value: '123',\n comment: 'Sentry in Frameworks',\n },\n ],\n },\n };\n\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Project',\n addSPMReference,\n );\n\n // -- Assert --\n const expectedXcodeProject = new XcodeProject(sourceProjectPath);\n expectedXcodeProject.objects.PBXFrameworksBuildPhase = {\n 'framework-id': {\n files: [\n {\n value: '123',\n comment: 'Sentry in Frameworks',\n },\n ],\n },\n };\n expect(xcodeProject.objects.PBXFrameworksBuildPhase).toEqual(\n expectedXcodeProject.objects.PBXFrameworksBuildPhase,\n );\n expect(xcodeProject.objects.XCRemoteSwiftPackageReference).toEqual(\n expectedXcodeProject.objects.XCRemoteSwiftPackageReference,\n );\n expect(\n xcodeProject.objects.XCSwiftPackageProductDependency,\n ).toEqual(\n expectedXcodeProject.objects.XCSwiftPackageProductDependency,\n );\n });\n });\n\n it('should add the SPM reference to the target', () => {\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Project',\n addSPMReference,\n );\n\n // -- Assert --\n // Get the target\n const target = xcodeProject.objects.PBXNativeTarget?.[\n 'D4E604CC2D50CEEC00CAB00F'\n ] as PBXNativeTarget;\n expect(target).toBeDefined();\n if (!target) {\n throw new Error('Target is undefined');\n }\n\n // Check the SPM dependency is added to the target\n expect(target.packageProductDependencies).toEqual([\n expect.objectContaining({\n value: expect.any(String) as string,\n comment: 'Sentry',\n }),\n ]);\n\n // Check the SPM package reference object is added to the project\n const remoteSwiftPackageReferences =\n xcodeProject.objects.XCRemoteSwiftPackageReference;\n expect(remoteSwiftPackageReferences).toBeDefined();\n if (!remoteSwiftPackageReferences) {\n throw new Error('XCRemoteSwiftPackageReference is undefined');\n }\n const rspRefKeys = Object.keys(remoteSwiftPackageReferences);\n expect(rspRefKeys).toHaveLength(2);\n // First key is expected to be the UUID of the SPM package reference\n expect(rspRefKeys[0]).toMatch(/^[A-F0-9]{24}$/i);\n // Second key is expected to be the UUID of the SPM package reference with _comment suffix\n expect(rspRefKeys[1]).toMatch(/^[A-F0-9]{24}_comment$/i);\n\n expect(remoteSwiftPackageReferences?.[rspRefKeys[0]]).toEqual({\n isa: 'XCRemoteSwiftPackageReference',\n repositoryURL: '\"https://github.com/getsentry/sentry-cocoa/\"',\n requirement: {\n kind: 'upToNextMajorVersion',\n minimumVersion: '8.0.0',\n },\n });\n expect(remoteSwiftPackageReferences?.[rspRefKeys[1]]).toBe(\n 'XCRemoteSwiftPackageReference \"sentry-cocoa\"',\n );\n\n // Check the SPM package is a dependency of the target\n const packageProductDependencies =\n xcodeProject.objects.XCSwiftPackageProductDependency;\n expect(packageProductDependencies).toBeDefined();\n if (!packageProductDependencies) {\n throw new Error('XCSwiftPackageProductDependency is undefined');\n }\n const ppDepKeys = Object.keys(packageProductDependencies);\n expect(ppDepKeys).toHaveLength(2);\n // First key is expected to be the UUID of the SPM package dependency\n expect(ppDepKeys[0]).toMatch(/^[A-F0-9]{24}$/i);\n // Second key is expected to be the UUID of the SPM package dependency with _comment suffix\n expect(ppDepKeys[1]).toMatch(/^[A-F0-9]{24}_comment$/i);\n expect(packageProductDependencies?.[ppDepKeys[0]]).toEqual({\n isa: 'XCSwiftPackageProductDependency',\n package: rspRefKeys[0],\n package_comment: 'XCRemoteSwiftPackageReference \"sentry-cocoa\"',\n productName: 'Sentry',\n });\n });\n });\n });\n });\n\n describe('filesForTarget', () => {\n describe('targets are undefined', () => {\n it('should return undefined', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXNativeTarget = undefined;\n\n // -- Act --\n const files = xcodeProject.filesForTarget('Project');\n\n // -- Assert --\n expect(files).toBeUndefined();\n });\n });\n\n describe('target not found', () => {\n it('should return undefined', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n\n // -- Act --\n const files = xcodeProject.filesForTarget('NonExistentTarget');\n\n // -- Assert --\n expect(files).toBeUndefined();\n });\n });\n\n describe('target build phases are undefined', () => {\n it('should return undefined', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXNativeTarget = {\n Project: {\n name: 'Project',\n buildPhases: undefined,\n },\n };\n\n // -- Act --\n const files = xcodeProject.filesForTarget('Project');\n\n // -- Assert --\n expect(files).toBeUndefined();\n });\n });\n\n describe('build phases are undefined', () => {\n it('should return undefined', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXNativeTarget = {\n Project: {\n name: 'Project',\n buildPhases: undefined,\n },\n };\n xcodeProject.objects.PBXSourcesBuildPhase = undefined;\n\n // -- Act --\n const files = xcodeProject.filesForTarget('Project');\n\n // -- Assert --\n expect(files).toBeUndefined();\n });\n });\n\n describe('referenced build phase is undefined', () => {\n it('should return undefined', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXNativeTarget = {\n Project: {\n name: 'Project',\n buildPhases: [\n {\n value: 'random-build-phase',\n },\n ],\n },\n };\n\n // -- Act --\n const files = xcodeProject.filesForTarget('Project');\n\n // -- Assert --\n expect(files).toBeUndefined();\n });\n });\n\n describe('build phase files are undefined', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXNativeTarget = {\n Project: {\n name: 'Project',\n buildPhases: [\n {\n value: 'build-phase-key',\n },\n ],\n },\n };\n xcodeProject.objects.PBXSourcesBuildPhase = {\n 'build-phase-key': {\n files: undefined,\n },\n };\n\n // -- Act --\n const files = xcodeProject.filesForTarget('Project');\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('build phase has no files', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n\n // -- Act --\n const files = xcodeProject.filesForTarget('Project');\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('build phase with files', () => {\n let xcodeProject: XcodeProject;\n\n beforeEach(() => {\n xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXNativeTarget = {\n 'some-target': {\n name: 'some-target',\n buildPhases: [\n {\n value: 'build-phase-key',\n },\n ],\n },\n };\n xcodeProject.objects.PBXSourcesBuildPhase = {\n 'build-phase-key': {\n files: [\n {\n value: 'file-key',\n },\n ],\n },\n };\n xcodeProject.objects.PBXBuildFile = {\n 'file-key': {\n isa: 'PBXBuildFile',\n fileRef: 'file-ref-key',\n },\n };\n xcodeProject.files = [\n {\n key: 'file-ref-key',\n path: 'file-path',\n },\n ];\n });\n\n describe('build file objects are not defined', () => {\n it('should return empty array', () => {\n // -- Arrange --\n xcodeProject.objects.PBXBuildFile = undefined;\n\n // -- Act --\n const files = xcodeProject.filesForTarget('some-target');\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('build file object is not found', () => {\n it('should return empty array', () => {\n // -- Arrange --\n xcodeProject.objects.PBXBuildFile = {};\n\n // -- Act --\n const files = xcodeProject.filesForTarget('some-target');\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('build file object exists', () => {\n describe('file reference is undefined', () => {\n it('should ignore the file', () => {\n // -- Arrange --\n xcodeProject.files = [];\n\n // -- Act --\n const files = xcodeProject.filesForTarget('some-target');\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n it('should return array of file paths', () => {\n // -- Act --\n const files = xcodeProject.filesForTarget('some-target');\n\n // -- Assert --\n expect(files).toEqual([\n path.join(\n appleProjectsPath,\n 'spm-swiftui-single-target',\n 'file-path',\n ),\n ]);\n });\n });\n });\n });\n\n describe('projectFiles', () => {\n describe('no groups in project', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXGroup = undefined;\n\n // -- Act --\n const files = xcodeProject.projectFiles();\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('main group not found', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n const project = xcodeProject.objects.PBXProject?.[\n 'D4E604C52D50CEEC00CAB00F'\n ] as PBXProject;\n if (project) {\n delete project.mainGroup;\n }\n\n // -- Act --\n const files = xcodeProject.projectFiles();\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('main group found', () => {\n it('should return array of file paths', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n\n // -- Act --\n const files = xcodeProject.projectFiles();\n\n // -- Assert --\n expect(files).toEqual([\n {\n key: 'D4E604CD2D50CEEC00CAB00F',\n path: 'Project.app',\n },\n ]);\n });\n\n it('should cache the result', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n\n // Smoke test\n expect(xcodeProject.files).toBeUndefined();\n\n // -- Act --\n const files = xcodeProject.projectFiles();\n\n // -- Assert --\n expect(xcodeProject.files).toBeDefined();\n expect(xcodeProject.files).toEqual(files);\n });\n });\n });\n\n describe('buildGroup', () => {\n describe('group has undefined children', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n const group: PBXGroup = {\n children: undefined,\n path: '',\n };\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('group has no children', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n const group: PBXGroup = {};\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('group child is file reference', () => {\n const group: PBXGroup = {\n children: [\n {\n value: 'D4E604CD2D50CEEC00CAB00F',\n },\n ],\n path: '',\n };\n\n describe('file references are undefined', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXFileReference = undefined;\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('file reference is string', () => {\n it('should be ignored', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n const group: PBXGroup = {\n children: [\n {\n value: 'D4E604CD2D50CEEC00CAB00F_comment',\n },\n ],\n path: '',\n };\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('file reference is valid', () => {\n it('should return array of escaped paths', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXFileReference = {\n D4E604CD2D50CEEC00CAB00F: {\n path: '\"some/path/to/file.swift\"',\n },\n };\n const group: PBXGroup = {\n children: [\n {\n value: 'D4E604CD2D50CEEC00CAB00F',\n },\n ],\n path: '',\n };\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([\n {\n key: 'D4E604CD2D50CEEC00CAB00F',\n path: 'some/path/to/file.swift',\n },\n ]);\n });\n });\n });\n\n describe('group child is group reference', () => {\n const group: PBXGroup = {\n children: [\n {\n value: 'D4E604C42D50CEEC00CAB00F',\n },\n ],\n path: '',\n };\n\n describe('groups are undefined', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXGroup = undefined;\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('group reference is string', () => {\n it('should return array of file paths', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n const group: PBXGroup = {\n children: [\n {\n value: 'D4E604CE2D50CEEC00CAB00F_comment',\n },\n ],\n path: '',\n };\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('group reference is valid', () => {\n it('should return array of file paths', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([\n {\n key: 'D4E604CD2D50CEEC00CAB00F',\n path: 'Project.app',\n },\n ]);\n });\n });\n\n describe('group reference has path', () => {\n it('should append the path to the file paths', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n const group: PBXGroup = {\n children: [\n {\n value: 'sub-group',\n },\n ],\n path: '\"some/path/to/group\"',\n };\n const subgroup: PBXGroup = {\n children: [\n {\n value: 'file-at-path',\n },\n ],\n };\n const file: PBXFileReference = {\n path: '\"some/file/at/path.swift\"',\n };\n xcodeProject.objects.PBXGroup = {\n 'main-group': group,\n 'sub-group': subgroup,\n };\n xcodeProject.objects.PBXFileReference = {\n 'file-at-path': file,\n };\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([\n {\n key: 'file-at-path',\n path: 'some/file/at/path.swift',\n },\n ]);\n });\n });\n });\n\n describe('group child is not a file reference or group', () => {\n it('should be ignored', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXGroup = {};\n xcodeProject.objects.PBXFileReference = {};\n const group: PBXGroup = {\n children: [\n {\n value: 'random-key',\n },\n ],\n path: '',\n };\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"xcode-manager.test.js","sourceRoot":"","sources":["../../../test/apple/xcode-manager.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,4CAA8B;AAC9B,gDAAkC;AASlC,yDAAiE;AACjE,iEAA6D;AAG7D,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1B,UAAU,EAAE,IAAI;IAChB,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;CACjC,CAAC,CAAC,CAAC;AACJ,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC;IACjC,GAAG,EAAE;QACH,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE;QACf,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE;QAClB,IAAI,EAAE,IAAI,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AAI,4BAAY,CAAC,uBAAuB,CAAC,CAAC;gBAC/D,YAAY,CAAC,OAAO,CAAC,QAAQ,GAAG,EAAE,CAAC;gBACnC,YAAY,CAAC,OAAO,CAAC,gBAAgB,GAAG,EAAE,CAAC;gBAC3C,MAAM,KAAK,GAAa;oBACtB,QAAQ,EAAE;wBACR;4BACE,KAAK,EAAE,YAAY;yBACpB;qBACF;oBACD,IAAI,EAAE,EAAE;iBACT,CAAC;gBAEF,YAAY;gBACZ,MAAM,KAAK,GAAG,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;gBAE7C,eAAe;gBACf,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC5B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport type {\n PBXFileReference,\n PBXGroup,\n PBXNativeTarget,\n PBXProject,\n PBXShellScriptBuildPhase,\n XCBuildConfiguration,\n} from 'xcode';\nimport { getRunScriptTemplate } from '../../src/apple/templates';\nimport { XcodeProject } from '../../src/apple/xcode-manager';\nimport type { SentryProjectData } from '../../src/utils/types';\n\njest.mock('node:fs', () => ({\n __esModule: true,\n ...jest.requireActual('node:fs'),\n}));\njest.mock('@clack/prompts', () => ({\n log: {\n info: jest.fn(),\n success: jest.fn(),\n step: jest.fn(),\n },\n}));\n\nconst appleProjectsPath = path.resolve(\n __dirname,\n '../../e2e-tests/test-applications/apple',\n);\nconst damagedProjectPath = path.join(\n appleProjectsPath,\n 'damaged-missing-configuration-list/Project.xcodeproj/project.pbxproj',\n);\nconst noTargetsProjectPath = path.join(\n appleProjectsPath,\n 'no-targets/Project.xcodeproj/project.pbxproj',\n);\nconst singleTargetProjectPath = path.join(\n appleProjectsPath,\n 'spm-swiftui-single-target/Project.xcodeproj/project.pbxproj',\n);\nconst multiTargetProjectPath = path.join(\n appleProjectsPath,\n 'spm-swiftui-multi-targets/Project.xcodeproj/project.pbxproj',\n);\nconst projectData: SentryProjectData = {\n id: '1234567890',\n slug: 'project',\n organization: {\n id: '1234567890',\n name: 'Sentry',\n slug: 'sentry',\n },\n keys: [{ dsn: { public: 'https://sentry.io/1234567890' } }],\n};\n\ndescribe('XcodeManager', () => {\n afterEach(() => {\n jest.clearAllMocks();\n });\n\n describe('XcodeProject', () => {\n describe('getAllTargets', () => {\n describe('single target', () => {\n it('should return all targets', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n\n // -- Act --\n const targets = xcodeProject.getAllTargets();\n\n // -- Assert --\n expect(targets).toEqual(['Project']);\n });\n });\n\n describe('multiple targets', () => {\n it('should return all targets', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(multiTargetProjectPath);\n\n // -- Act --\n const targets = xcodeProject.getAllTargets();\n\n // -- Assert --\n expect(targets).toEqual(['Project1', 'Project2']);\n });\n });\n\n describe('no targets', () => {\n it('should return an empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(noTargetsProjectPath);\n\n // -- Act --\n const targets = xcodeProject.getAllTargets();\n\n // -- Assert --\n expect(targets).toEqual([]);\n });\n });\n\n describe('project with missing configuration list', () => {\n it('should return an empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(damagedProjectPath);\n\n // -- Act --\n const targets = xcodeProject.getAllTargets();\n\n // -- Assert --\n expect(targets).toEqual([]);\n });\n });\n });\n\n describe('updateXcodeProject', () => {\n let sourceProjectPath: string;\n let tempProjectPath: string;\n let xcodeProject: XcodeProject;\n\n beforeEach(() => {\n const tempDir = fs.mkdtempSync(\n path.join(os.tmpdir(), 'update-xcode-project'),\n );\n\n sourceProjectPath = singleTargetProjectPath;\n tempProjectPath = path.resolve(tempDir, 'project.pbxproj');\n\n fs.copyFileSync(sourceProjectPath, tempProjectPath);\n xcodeProject = new XcodeProject(tempProjectPath);\n });\n\n describe('upload symbols script', () => {\n const scriptVariants: {\n uploadSource: boolean;\n includeHomebrewPath: boolean;\n }[] = [\n {\n uploadSource: true,\n includeHomebrewPath: true,\n },\n {\n uploadSource: true,\n includeHomebrewPath: false,\n },\n {\n uploadSource: false,\n includeHomebrewPath: true,\n },\n {\n uploadSource: false,\n includeHomebrewPath: false,\n },\n ];\n\n for (const variant of scriptVariants) {\n describe(`upload source = ${variant.uploadSource?.toString()} and include homebrew path = ${variant.includeHomebrewPath.toString()}`, () => {\n beforeEach(() => {\n jest\n .spyOn(fs, 'existsSync')\n .mockReturnValue(variant.includeHomebrewPath);\n });\n\n afterEach(() => {\n jest.restoreAllMocks();\n });\n\n it('should add the upload symbols script to the target', () => {\n // -- Arrange --\n const generatedShellScript = getRunScriptTemplate(\n projectData.organization.slug,\n projectData.slug,\n variant.uploadSource,\n variant.includeHomebrewPath,\n );\n const expectedShellScript = `\"${generatedShellScript.replace(\n /\"/g,\n '\\\\\"',\n )}\"`;\n\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Project',\n false, // Ignore SPM reference\n variant.uploadSource,\n );\n\n // -- Assert --\n const updatedXcodeProject = new XcodeProject(tempProjectPath);\n\n // Expect the upload symbols script to be added\n const scriptObjects =\n updatedXcodeProject.objects.PBXShellScriptBuildPhase;\n expect(scriptObjects).toBeDefined();\n if (!scriptObjects) {\n throw new Error('Script objects not found');\n }\n const scriptKeys = Object.keys(scriptObjects);\n expect(scriptKeys).toHaveLength(2);\n\n // Find the script ID\n const scriptId = scriptKeys.find(\n (key) => !key.endsWith('_comment'),\n );\n expect(scriptId).toBeDefined();\n if (!scriptId) {\n throw new Error('Script ID not found');\n }\n expect(scriptId).toMatch(/^[A-F0-9]{24}$/i);\n\n // Expect the script to be added\n const script = scriptObjects[\n scriptId\n ] as PBXShellScriptBuildPhase;\n expect(script).toBeDefined();\n expect(typeof script).not.toBe('string');\n expect(script.inputPaths).toEqual([\n '\"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}\"',\n ]);\n expect(script.outputPaths).toEqual([]);\n expect(script.shellPath).toBe('/bin/sh');\n expect(script.shellScript).toEqual(expectedShellScript);\n\n const commentKey = `${scriptId}_comment`;\n expect(scriptKeys).toContain(commentKey);\n expect(scriptObjects[commentKey]).toBe(\n 'Upload Debug Symbols to Sentry',\n );\n });\n });\n }\n });\n\n describe('debug information format and sandbox', () => {\n describe('upload source is false', () => {\n it('should not update the Xcode project', () => {\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Project',\n false, // Ignore SPM reference\n false,\n );\n\n // -- Assert --\n const expectedXcodeProject = new XcodeProject(sourceProjectPath);\n expect(xcodeProject.objects.XCBuildConfiguration).toEqual(\n expectedXcodeProject.objects.XCBuildConfiguration,\n );\n });\n });\n\n describe('upload source is true', () => {\n const uploadSource = true;\n\n describe('named target not found', () => {\n it('should not update the flags in the Xcode project', () => {\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Invalid Target Name',\n false, // Ignore SPM reference\n uploadSource,\n );\n\n // -- Assert --\n const originalXcodeProject = new XcodeProject(sourceProjectPath);\n expect(xcodeProject.objects.XCBuildConfiguration).toEqual(\n originalXcodeProject.objects.XCBuildConfiguration,\n );\n });\n });\n\n describe('named target found', () => {\n describe('build configurations is undefined', () => {\n it('should not update the Xcode project', () => {\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Invalid Target Name',\n false, // Ignore SPM reference\n uploadSource,\n );\n\n // -- Assert --\n const originalXcodeProject = new XcodeProject(\n sourceProjectPath,\n );\n expect(xcodeProject.objects.XCBuildConfiguration).toEqual(\n originalXcodeProject.objects.XCBuildConfiguration,\n );\n });\n });\n\n describe('no build configurations found', () => {\n it('should not update the Xcode project', () => {\n // -- Arrange --\n xcodeProject.objects.XCBuildConfiguration = {};\n\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Invalid Target Name',\n false, // Ignore SPM reference\n uploadSource,\n );\n\n // -- Assert --\n expect(xcodeProject.objects.XCBuildConfiguration).toEqual({});\n });\n });\n\n describe('build configurations found', () => {\n const debugProjectBuildConfigurationListId =\n 'D4E604DA2D50CEEE00CAB00F';\n const releaseProjectBuildConfigurationListId =\n 'D4E604DB2D50CEEE00CAB00F';\n const debugTargetBuildConfigurationListId =\n 'D4E604DD2D50CEEE00CAB00F';\n const releaseTargetBuildConfigurationListId =\n 'D4E604DE2D50CEEE00CAB00F';\n\n it('should update the target configuration lists', () => {\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Project',\n false, // Ignore SPM reference\n uploadSource,\n );\n\n // -- Assert --\n expect(xcodeProject.objects.XCBuildConfiguration).toBeDefined();\n // Both Debug and Release are configured equally\n const expectedConfigKeys = [\n debugTargetBuildConfigurationListId, // Debug\n releaseTargetBuildConfigurationListId, // Release\n ];\n for (const key of expectedConfigKeys) {\n const buildConfiguration = xcodeProject.objects\n .XCBuildConfiguration?.[key] as XCBuildConfiguration;\n expect(buildConfiguration).toBeDefined();\n expect(typeof buildConfiguration).not.toBe('string');\n const buildSettings = buildConfiguration.buildSettings ?? {};\n expect(buildSettings.DEBUG_INFORMATION_FORMAT).toBe(\n '\"dwarf-with-dsym\"',\n );\n expect(buildSettings.ENABLE_USER_SCRIPT_SANDBOXING).toBe(\n '\"NO\"',\n );\n }\n });\n\n it('should not update the project configuration lists', () => {\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Project',\n false, // Ignore SPM reference\n uploadSource,\n );\n\n // -- Assert --\n expect(xcodeProject.objects.XCBuildConfiguration).toBeDefined();\n\n // Check project build configurations 'Debug'\n const debugBuildConfiguration = xcodeProject.objects\n .XCBuildConfiguration?.[\n debugProjectBuildConfigurationListId\n ] as XCBuildConfiguration;\n expect(debugBuildConfiguration).toBeDefined();\n expect(typeof debugBuildConfiguration).not.toBe('string');\n expect(\n debugBuildConfiguration.buildSettings\n ?.DEBUG_INFORMATION_FORMAT,\n ).toBe('dwarf');\n expect(\n debugBuildConfiguration.buildSettings\n ?.ENABLE_USER_SCRIPT_SANDBOXING,\n ).toBe('YES');\n\n // Check project build configurations 'Release'\n const releaseBuildConfiguration = xcodeProject.objects\n .XCBuildConfiguration?.[\n releaseProjectBuildConfigurationListId\n ] as XCBuildConfiguration;\n expect(releaseBuildConfiguration).toBeDefined();\n expect(typeof releaseBuildConfiguration).not.toBe('string');\n expect(\n releaseBuildConfiguration.buildSettings\n ?.DEBUG_INFORMATION_FORMAT,\n ).toBe('\"dwarf-with-dsym\"');\n expect(\n releaseBuildConfiguration.buildSettings\n ?.ENABLE_USER_SCRIPT_SANDBOXING,\n ).toBe('YES');\n });\n });\n });\n });\n });\n\n describe('add SPM reference', () => {\n const addSPMReference = true;\n\n describe('framework build phase already contains Sentry', () => {\n it('should not update the Xcode project', () => {\n // -- Arrange --\n xcodeProject.objects.PBXFrameworksBuildPhase = {\n 'framework-id': {\n files: [\n {\n value: '123',\n comment: 'Sentry in Frameworks',\n },\n ],\n },\n };\n\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Project',\n addSPMReference,\n );\n\n // -- Assert --\n const expectedXcodeProject = new XcodeProject(sourceProjectPath);\n expectedXcodeProject.objects.PBXFrameworksBuildPhase = {\n 'framework-id': {\n files: [\n {\n value: '123',\n comment: 'Sentry in Frameworks',\n },\n ],\n },\n };\n expect(xcodeProject.objects.PBXFrameworksBuildPhase).toEqual(\n expectedXcodeProject.objects.PBXFrameworksBuildPhase,\n );\n expect(xcodeProject.objects.XCRemoteSwiftPackageReference).toEqual(\n expectedXcodeProject.objects.XCRemoteSwiftPackageReference,\n );\n expect(\n xcodeProject.objects.XCSwiftPackageProductDependency,\n ).toEqual(\n expectedXcodeProject.objects.XCSwiftPackageProductDependency,\n );\n });\n });\n\n it('should add the SPM reference to the target', () => {\n // -- Act --\n xcodeProject.updateXcodeProject(\n projectData,\n 'Project',\n addSPMReference,\n );\n\n // -- Assert --\n // Get the target\n const target = xcodeProject.objects.PBXNativeTarget?.[\n 'D4E604CC2D50CEEC00CAB00F'\n ] as PBXNativeTarget;\n expect(target).toBeDefined();\n if (!target) {\n throw new Error('Target is undefined');\n }\n\n // Check the SPM dependency is added to the target\n expect(target.packageProductDependencies).toEqual([\n expect.objectContaining({\n value: expect.any(String) as string,\n comment: 'Sentry',\n }),\n ]);\n\n // Check the SPM package reference object is added to the project\n const remoteSwiftPackageReferences =\n xcodeProject.objects.XCRemoteSwiftPackageReference;\n expect(remoteSwiftPackageReferences).toBeDefined();\n if (!remoteSwiftPackageReferences) {\n throw new Error('XCRemoteSwiftPackageReference is undefined');\n }\n const rspRefKeys = Object.keys(remoteSwiftPackageReferences);\n expect(rspRefKeys).toHaveLength(2);\n // First key is expected to be the UUID of the SPM package reference\n expect(rspRefKeys[0]).toMatch(/^[A-F0-9]{24}$/i);\n // Second key is expected to be the UUID of the SPM package reference with _comment suffix\n expect(rspRefKeys[1]).toMatch(/^[A-F0-9]{24}_comment$/i);\n\n expect(remoteSwiftPackageReferences?.[rspRefKeys[0]]).toEqual({\n isa: 'XCRemoteSwiftPackageReference',\n repositoryURL: '\"https://github.com/getsentry/sentry-cocoa/\"',\n requirement: {\n kind: 'upToNextMajorVersion',\n minimumVersion: '8.0.0',\n },\n });\n expect(remoteSwiftPackageReferences?.[rspRefKeys[1]]).toBe(\n 'XCRemoteSwiftPackageReference \"sentry-cocoa\"',\n );\n\n // Check the SPM package is a dependency of the target\n const packageProductDependencies =\n xcodeProject.objects.XCSwiftPackageProductDependency;\n expect(packageProductDependencies).toBeDefined();\n if (!packageProductDependencies) {\n throw new Error('XCSwiftPackageProductDependency is undefined');\n }\n const ppDepKeys = Object.keys(packageProductDependencies);\n expect(ppDepKeys).toHaveLength(2);\n // First key is expected to be the UUID of the SPM package dependency\n expect(ppDepKeys[0]).toMatch(/^[A-F0-9]{24}$/i);\n // Second key is expected to be the UUID of the SPM package dependency with _comment suffix\n expect(ppDepKeys[1]).toMatch(/^[A-F0-9]{24}_comment$/i);\n expect(packageProductDependencies?.[ppDepKeys[0]]).toEqual({\n isa: 'XCSwiftPackageProductDependency',\n package: rspRefKeys[0],\n package_comment: 'XCRemoteSwiftPackageReference \"sentry-cocoa\"',\n productName: 'Sentry',\n });\n });\n });\n });\n });\n\n describe('filesForTarget', () => {\n describe('targets are undefined', () => {\n it('should return undefined', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXNativeTarget = undefined;\n\n // -- Act --\n const files = xcodeProject.filesForTarget('Project');\n\n // -- Assert --\n expect(files).toBeUndefined();\n });\n });\n\n describe('target not found', () => {\n it('should return undefined', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n\n // -- Act --\n const files = xcodeProject.filesForTarget('NonExistentTarget');\n\n // -- Assert --\n expect(files).toBeUndefined();\n });\n });\n\n describe('target build phases are undefined', () => {\n it('should return undefined', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXNativeTarget = {\n Project: {\n name: 'Project',\n buildPhases: undefined,\n },\n };\n\n // -- Act --\n const files = xcodeProject.filesForTarget('Project');\n\n // -- Assert --\n expect(files).toBeUndefined();\n });\n });\n\n describe('build phases are undefined', () => {\n it('should return undefined', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXNativeTarget = {\n Project: {\n name: 'Project',\n buildPhases: undefined,\n },\n };\n xcodeProject.objects.PBXSourcesBuildPhase = undefined;\n\n // -- Act --\n const files = xcodeProject.filesForTarget('Project');\n\n // -- Assert --\n expect(files).toBeUndefined();\n });\n });\n\n describe('referenced build phase is undefined', () => {\n it('should return undefined', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXNativeTarget = {\n Project: {\n name: 'Project',\n buildPhases: [\n {\n value: 'random-build-phase',\n },\n ],\n },\n };\n\n // -- Act --\n const files = xcodeProject.filesForTarget('Project');\n\n // -- Assert --\n expect(files).toBeUndefined();\n });\n });\n\n describe('build phase files are undefined', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXNativeTarget = {\n Project: {\n name: 'Project',\n buildPhases: [\n {\n value: 'build-phase-key',\n },\n ],\n },\n };\n xcodeProject.objects.PBXSourcesBuildPhase = {\n 'build-phase-key': {\n files: undefined,\n },\n };\n\n // -- Act --\n const files = xcodeProject.filesForTarget('Project');\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('build phase has no files', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n\n // -- Act --\n const files = xcodeProject.filesForTarget('Project');\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('build phase with files', () => {\n let xcodeProject: XcodeProject;\n\n beforeEach(() => {\n xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXNativeTarget = {\n 'some-target': {\n name: 'some-target',\n buildPhases: [\n {\n value: 'build-phase-key',\n },\n ],\n },\n };\n xcodeProject.objects.PBXSourcesBuildPhase = {\n 'build-phase-key': {\n files: [\n {\n value: 'file-key',\n },\n ],\n },\n };\n xcodeProject.objects.PBXBuildFile = {\n 'file-key': {\n isa: 'PBXBuildFile',\n fileRef: 'file-ref-key',\n },\n };\n xcodeProject.files = [\n {\n key: 'file-ref-key',\n path: 'file-path',\n },\n ];\n });\n\n describe('build file objects are not defined', () => {\n it('should return empty array', () => {\n // -- Arrange --\n xcodeProject.objects.PBXBuildFile = undefined;\n\n // -- Act --\n const files = xcodeProject.filesForTarget('some-target');\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('build file object is not found', () => {\n it('should return empty array', () => {\n // -- Arrange --\n xcodeProject.objects.PBXBuildFile = {};\n\n // -- Act --\n const files = xcodeProject.filesForTarget('some-target');\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('build file object exists', () => {\n describe('file reference is undefined', () => {\n it('should ignore the file', () => {\n // -- Arrange --\n xcodeProject.files = [];\n\n // -- Act --\n const files = xcodeProject.filesForTarget('some-target');\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n it('should return array of file paths', () => {\n // -- Act --\n const files = xcodeProject.filesForTarget('some-target');\n\n // -- Assert --\n expect(files).toEqual([\n path.join(\n appleProjectsPath,\n 'spm-swiftui-single-target',\n 'file-path',\n ),\n ]);\n });\n });\n });\n });\n\n describe('projectFiles', () => {\n describe('no groups in project', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXGroup = undefined;\n\n // -- Act --\n const files = xcodeProject.projectFiles();\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('main group not found', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n const project = xcodeProject.objects.PBXProject?.[\n 'D4E604C52D50CEEC00CAB00F'\n ] as PBXProject;\n if (project) {\n delete project.mainGroup;\n }\n\n // -- Act --\n const files = xcodeProject.projectFiles();\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('main group found', () => {\n it('should return array of file paths', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n\n // -- Act --\n const files = xcodeProject.projectFiles();\n\n // -- Assert --\n expect(files).toEqual([\n {\n key: 'D4E604CD2D50CEEC00CAB00F',\n path: 'Project.app',\n },\n ]);\n });\n\n it('should cache the result', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n\n // Smoke test\n expect(xcodeProject.files).toBeUndefined();\n\n // -- Act --\n const files = xcodeProject.projectFiles();\n\n // -- Assert --\n expect(xcodeProject.files).toBeDefined();\n expect(xcodeProject.files).toEqual(files);\n });\n });\n });\n\n describe('buildGroup', () => {\n describe('group has undefined children', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n const group: PBXGroup = {\n children: undefined,\n path: '',\n };\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('group has no children', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n const group: PBXGroup = {};\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('group child is file reference', () => {\n const group: PBXGroup = {\n children: [\n {\n value: 'D4E604CD2D50CEEC00CAB00F',\n },\n ],\n path: '',\n };\n\n describe('file references are undefined', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXFileReference = undefined;\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('file reference is string', () => {\n it('should be ignored', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n const group: PBXGroup = {\n children: [\n {\n value: 'D4E604CD2D50CEEC00CAB00F_comment',\n },\n ],\n path: '',\n };\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('file reference is valid', () => {\n it('should return array of escaped paths', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXFileReference = {\n D4E604CD2D50CEEC00CAB00F: {\n path: '\"some/path/to/file.swift\"',\n },\n };\n const group: PBXGroup = {\n children: [\n {\n value: 'D4E604CD2D50CEEC00CAB00F',\n },\n ],\n path: '',\n };\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([\n {\n key: 'D4E604CD2D50CEEC00CAB00F',\n path: 'some/path/to/file.swift',\n },\n ]);\n });\n });\n });\n\n describe('group child is group reference', () => {\n const group: PBXGroup = {\n children: [\n {\n value: 'D4E604C42D50CEEC00CAB00F',\n },\n ],\n path: '',\n };\n\n describe('groups are undefined', () => {\n it('should return empty array', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXGroup = undefined;\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('group reference is string', () => {\n it('should return array of file paths', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n const group: PBXGroup = {\n children: [\n {\n value: 'D4E604CE2D50CEEC00CAB00F_comment',\n },\n ],\n path: '',\n };\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n\n describe('group reference is valid', () => {\n it('should return array of file paths', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([\n {\n key: 'D4E604CD2D50CEEC00CAB00F',\n path: 'Project.app',\n },\n ]);\n });\n });\n\n describe('group reference has path', () => {\n it('should append the path to the file paths', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n const group: PBXGroup = {\n children: [\n {\n value: 'sub-group',\n },\n ],\n path: '\"some/path/to/group\"',\n };\n const subgroup: PBXGroup = {\n children: [\n {\n value: 'file-at-path',\n },\n ],\n };\n const file: PBXFileReference = {\n path: '\"some/file/at/path.swift\"',\n };\n xcodeProject.objects.PBXGroup = {\n 'main-group': group,\n 'sub-group': subgroup,\n };\n xcodeProject.objects.PBXFileReference = {\n 'file-at-path': file,\n };\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([\n {\n key: 'file-at-path',\n path: 'some/file/at/path.swift',\n },\n ]);\n });\n });\n });\n\n describe('group child is not a file reference or group', () => {\n it('should be ignored', () => {\n // -- Arrange --\n const xcodeProject = new XcodeProject(singleTargetProjectPath);\n xcodeProject.objects.PBXGroup = {};\n xcodeProject.objects.PBXFileReference = {};\n const group: PBXGroup = {\n children: [\n {\n value: 'random-key',\n },\n ],\n path: '',\n };\n\n // -- Act --\n const files = xcodeProject.buildGroup(group);\n\n // -- Assert --\n expect(files).toEqual([]);\n });\n });\n });\n});\n"]}
|
|
@@ -234,7 +234,7 @@ describe('Next.js code templates', () => {
|
|
|
234
234
|
expect(template).toMatchInlineSnapshot(`
|
|
235
235
|
"{
|
|
236
236
|
// For all available options, see:
|
|
237
|
-
// https://
|
|
237
|
+
// https://www.npmjs.com/package/@sentry/webpack-plugin#options
|
|
238
238
|
|
|
239
239
|
org: "my-org",
|
|
240
240
|
project: "my-project",
|
|
@@ -277,7 +277,7 @@ describe('Next.js code templates', () => {
|
|
|
277
277
|
expect(template).toMatchInlineSnapshot(`
|
|
278
278
|
"{
|
|
279
279
|
// For all available options, see:
|
|
280
|
-
// https://
|
|
280
|
+
// https://www.npmjs.com/package/@sentry/webpack-plugin#options
|
|
281
281
|
|
|
282
282
|
org: "my-org",
|
|
283
283
|
project: "my-project",
|
|
@@ -321,7 +321,7 @@ describe('Next.js code templates', () => {
|
|
|
321
321
|
expect(template).toMatchInlineSnapshot(`
|
|
322
322
|
"{
|
|
323
323
|
// For all available options, see:
|
|
324
|
-
// https://
|
|
324
|
+
// https://www.npmjs.com/package/@sentry/webpack-plugin#options
|
|
325
325
|
|
|
326
326
|
org: "my-org",
|
|
327
327
|
project: "my-project",
|
|
@@ -364,7 +364,7 @@ describe('Next.js code templates', () => {
|
|
|
364
364
|
expect(template).toMatchInlineSnapshot(`
|
|
365
365
|
"{
|
|
366
366
|
// For all available options, see:
|
|
367
|
-
// https://
|
|
367
|
+
// https://www.npmjs.com/package/@sentry/webpack-plugin#options
|
|
368
368
|
|
|
369
369
|
org: "my-org",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;;;;;;OAiCtC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;YACtE,MAAM,QAAQ,GAAG,IAAA,8CAAkC,EAAC;gBAClD,OAAO,EAAE,QAAQ;gBACjB,WAAW,EAAE,YAAY;gBACzB,UAAU,EAAE,KAAK;gBACjB,SAAS,EAAE,+BAA+B;gBAC1C,WAAW,EAAE,KAAK;gBAClB,wBAAwB,EAAE,KAAK;aAChC,CAAC,CAAC;YAEH,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCtC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mFAAmF,EAAE,GAAG,EAAE;YAC3F,MAAM,QAAQ,GAAG,IAAA,8CAAkC,EAAC;gBAClD,OAAO,EAAE,QAAQ;gBACjB,WAAW,EAAE,YAAY;gBACzB,UAAU,EAAE,KAAK;gBACjB,SAAS,EAAE,+BAA+B;gBAC1C,WAAW,EAAE,IAAI;gBACjB,wBAAwB,EAAE,IAAI;aAC/B,CAAC,CAAC;YAEH,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAqChC,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {\n getSentryConfigContents,\n getWithSentryConfigOptionsTemplate,\n} from '../../src/nextjs/templates';\n\ndescribe('Next.js code templates', () => {\n describe('getSentryConfigContents', () => {\n describe('client-side', () => {\n it('generates client-side Sentry config with all features enabled', () => {\n const template = getSentryConfigContents('my-dsn', 'client', {\n performance: true,\n replay: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry on the client.\n // The config you add here will be used whenever a users loads a page in their browser.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Add optional integrations for additional features\n integrations: [\n Sentry.replayIntegration(),\n ],\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\n\n // Define how likely Replay events are sampled.\n // This sets the sample rate to be 10%. You may want this to be 100% while\n // in development and sample at a lower rate in production\n replaysSessionSampleRate: 0.1,\n\n // Define how likely Replay events are sampled when an error occurs.\n replaysOnErrorSampleRate: 1.0,\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n\n it('generates client-side Sentry config with performance monitoring disabled', () => {\n const template = getSentryConfigContents('my-dsn', 'client', {\n performance: false,\n replay: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry on the client.\n // The config you add here will be used whenever a users loads a page in their browser.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Add optional integrations for additional features\n integrations: [\n Sentry.replayIntegration(),\n ],\n\n // Define how likely Replay events are sampled.\n // This sets the sample rate to be 10%. You may want this to be 100% while\n // in development and sample at a lower rate in production\n replaysSessionSampleRate: 0.1,\n\n // Define how likely Replay events are sampled when an error occurs.\n replaysOnErrorSampleRate: 1.0,\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n\n it('generates client-side Sentry config with session replay disabled', () => {\n const template = getSentryConfigContents('my-dsn', 'client', {\n performance: true,\n replay: false,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry on the client.\n // The config you add here will be used whenever a users loads a page in their browser.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n });\n\n describe('server-side', () => {\n it('generates server-side Sentry config with all features enabled', () => {\n const template = getSentryConfigContents('my-dsn', 'server', {\n performance: true,\n replay: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry on the server.\n // The config you add here will be used whenever the server handles a request.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n\n it('generates server-side Sentry config with performance monitoring disabled', () => {\n const template = getSentryConfigContents('my-dsn', 'server', {\n performance: false,\n replay: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry on the server.\n // The config you add here will be used whenever the server handles a request.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n\n it('generates server-side Sentry config with spotlight disabled', () => {\n const template = getSentryConfigContents('my-dsn', 'server', {\n performance: true,\n replay: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry on the server.\n // The config you add here will be used whenever the server handles a request.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n });\n\n describe('edge', () => {\n it('generates edge Sentry config with all features enabled', () => {\n const template = getSentryConfigContents('my-dsn', 'edge', {\n performance: true,\n replay: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).\n // The config you add here will be used whenever one of the edge features is loaded.\n // Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n\n it('generates edge Sentry config with performance monitoring disabled', () => {\n const template = getSentryConfigContents('my-dsn', 'edge', {\n performance: false,\n replay: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).\n // The config you add here will be used whenever one of the edge features is loaded.\n // Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n });\n });\n\n describe('getWithSentryConfigOptionsTemplate', () => {\n it('generates options for SaaS', () => {\n const template = getWithSentryConfigOptionsTemplate({\n orgSlug: 'my-org',\n projectSlug: 'my-project',\n selfHosted: false,\n sentryUrl: 'https://dont-use-this-url.com',\n tunnelRoute: true,\n reactComponentAnnotation: false,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"{\n // For all available options, see:\n // https://github.com/getsentry/sentry-webpack-plugin#options\n\n org: \"my-org\",\n project: \"my-project\",\n\n // Only print logs for uploading source maps in CI\n silent: !process.env.CI,\n\n // For all available options, see:\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/\n\n // Upload a larger set of source maps for prettier stack traces (increases build time)\n widenClientFileUpload: true,\n\n // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n tunnelRoute: \"/monitoring\",\n\n // Automatically tree-shake Sentry logger statements to reduce bundle size\n disableLogger: true,\n\n // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)\n // See the following for more information:\n // https://docs.sentry.io/product/crons/\n // https://vercel.com/docs/cron-jobs\n automaticVercelMonitors: true,\n }\"\n `);\n });\n\n it('generates options for self-hosted', () => {\n const template = getWithSentryConfigOptionsTemplate({\n orgSlug: 'my-org',\n projectSlug: 'my-project',\n selfHosted: true,\n sentryUrl: 'https://my-sentry.com',\n tunnelRoute: true,\n reactComponentAnnotation: false,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"{\n // For all available options, see:\n // https://github.com/getsentry/sentry-webpack-plugin#options\n\n org: \"my-org\",\n project: \"my-project\",\n sentryUrl: \"https://my-sentry.com\",\n\n // Only print logs for uploading source maps in CI\n silent: !process.env.CI,\n\n // For all available options, see:\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/\n\n // Upload a larger set of source maps for prettier stack traces (increases build time)\n widenClientFileUpload: true,\n\n // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n tunnelRoute: \"/monitoring\",\n\n // Automatically tree-shake Sentry logger statements to reduce bundle size\n disableLogger: true,\n\n // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)\n // See the following for more information:\n // https://docs.sentry.io/product/crons/\n // https://vercel.com/docs/cron-jobs\n automaticVercelMonitors: true,\n }\"\n `);\n });\n\n it('comments out tunnelRoute if `tunnelRoute` option is disabled', () => {\n const template = getWithSentryConfigOptionsTemplate({\n orgSlug: 'my-org',\n projectSlug: 'my-project',\n selfHosted: false,\n sentryUrl: 'https://dont-use-this-url.com',\n tunnelRoute: false,\n reactComponentAnnotation: false,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"{\n // For all available options, see:\n // https://github.com/getsentry/sentry-webpack-plugin#options\n\n org: \"my-org\",\n project: \"my-project\",\n\n // Only print logs for uploading source maps in CI\n silent: !process.env.CI,\n\n // For all available options, see:\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/\n\n // Upload a larger set of source maps for prettier stack traces (increases build time)\n widenClientFileUpload: true,\n\n // Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n // tunnelRoute: \"/monitoring\",\n\n // Automatically tree-shake Sentry logger statements to reduce bundle size\n disableLogger: true,\n\n // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)\n // See the following for more information:\n // https://docs.sentry.io/product/crons/\n // https://vercel.com/docs/cron-jobs\n automaticVercelMonitors: true,\n }\"\n `);\n });\n\n it('adds `reactComponentAnnotations` option if `reactComponentAnnotations` is enabled', () => {\n const template = getWithSentryConfigOptionsTemplate({\n orgSlug: 'my-org',\n projectSlug: 'my-project',\n selfHosted: false,\n sentryUrl: 'https://dont-use-this-url.com',\n tunnelRoute: true,\n reactComponentAnnotation: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"{\n // For all available options, see:\n // https://github.com/getsentry/sentry-webpack-plugin#options\n\n org: \"my-org\",\n project: \"my-project\",\n\n // Only print logs for uploading source maps in CI\n silent: !process.env.CI,\n\n // For all available options, see:\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/\n\n // Upload a larger set of source maps for prettier stack traces (increases build time)\n widenClientFileUpload: true,\n\n // Automatically annotate React components to show their full name in breadcrumbs and session replay\n reactComponentAnnotation: {\n enabled: true,\n },\n\n // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n tunnelRoute: \"/monitoring\",\n\n // Automatically tree-shake Sentry logger statements to reduce bundle size\n disableLogger: true,\n\n // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)\n // See the following for more information:\n // https://docs.sentry.io/product/crons/\n // https://vercel.com/docs/cron-jobs\n automaticVercelMonitors: true,\n }\"\n `);\n });\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/nextjs/templates.test.ts"],"names":[],"mappings":";;AAAA,0DAGoC;AAEpC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACvC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;YAC3B,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;gBACvE,MAAM,QAAQ,GAAG,IAAA,mCAAuB,EAAC,QAAQ,EAAE,QAAQ,EAAE;oBAC3D,WAAW,EAAE,IAAI;oBACjB,MAAM,EAAE,IAAI;iBACb,CAAC,CAAC;gBAEH,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA8BtC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,0EAA0E,EAAE,GAAG,EAAE;gBAClF,MAAM,QAAQ,GAAG,IAAA,mCAAuB,EAAC,QAAQ,EAAE,QAAQ,EAAE;oBAC3D,WAAW,EAAE,KAAK;oBAClB,MAAM,EAAE,IAAI;iBACb,CAAC,CAAC;gBAEH,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;SA2BtC,CAAC,CAAC;YAC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,CAAC","sourcesContent":["import {\n getSentryConfigContents,\n getWithSentryConfigOptionsTemplate,\n} from '../../src/nextjs/templates';\n\ndescribe('Next.js code templates', () => {\n describe('getSentryConfigContents', () => {\n describe('client-side', () => {\n it('generates client-side Sentry config with all features enabled', () => {\n const template = getSentryConfigContents('my-dsn', 'client', {\n performance: true,\n replay: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry on the client.\n // The config you add here will be used whenever a users loads a page in their browser.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Add optional integrations for additional features\n integrations: [\n Sentry.replayIntegration(),\n ],\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\n\n // Define how likely Replay events are sampled.\n // This sets the sample rate to be 10%. You may want this to be 100% while\n // in development and sample at a lower rate in production\n replaysSessionSampleRate: 0.1,\n\n // Define how likely Replay events are sampled when an error occurs.\n replaysOnErrorSampleRate: 1.0,\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n\n it('generates client-side Sentry config with performance monitoring disabled', () => {\n const template = getSentryConfigContents('my-dsn', 'client', {\n performance: false,\n replay: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry on the client.\n // The config you add here will be used whenever a users loads a page in their browser.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Add optional integrations for additional features\n integrations: [\n Sentry.replayIntegration(),\n ],\n\n // Define how likely Replay events are sampled.\n // This sets the sample rate to be 10%. You may want this to be 100% while\n // in development and sample at a lower rate in production\n replaysSessionSampleRate: 0.1,\n\n // Define how likely Replay events are sampled when an error occurs.\n replaysOnErrorSampleRate: 1.0,\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n\n it('generates client-side Sentry config with session replay disabled', () => {\n const template = getSentryConfigContents('my-dsn', 'client', {\n performance: true,\n replay: false,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry on the client.\n // The config you add here will be used whenever a users loads a page in their browser.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n });\n\n describe('server-side', () => {\n it('generates server-side Sentry config with all features enabled', () => {\n const template = getSentryConfigContents('my-dsn', 'server', {\n performance: true,\n replay: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry on the server.\n // The config you add here will be used whenever the server handles a request.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n\n it('generates server-side Sentry config with performance monitoring disabled', () => {\n const template = getSentryConfigContents('my-dsn', 'server', {\n performance: false,\n replay: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry on the server.\n // The config you add here will be used whenever the server handles a request.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n\n it('generates server-side Sentry config with spotlight disabled', () => {\n const template = getSentryConfigContents('my-dsn', 'server', {\n performance: true,\n replay: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry on the server.\n // The config you add here will be used whenever the server handles a request.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n });\n\n describe('edge', () => {\n it('generates edge Sentry config with all features enabled', () => {\n const template = getSentryConfigContents('my-dsn', 'edge', {\n performance: true,\n replay: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).\n // The config you add here will be used whenever one of the edge features is loaded.\n // Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.\n tracesSampleRate: 1,\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n\n it('generates edge Sentry config with performance monitoring disabled', () => {\n const template = getSentryConfigContents('my-dsn', 'edge', {\n performance: false,\n replay: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).\n // The config you add here will be used whenever one of the edge features is loaded.\n // Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/\n\n import * as Sentry from \"@sentry/nextjs\";\n\n Sentry.init({\n dsn: \"my-dsn\",\n\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\n debug: false,\n });\n \"\n `);\n });\n });\n });\n\n describe('getWithSentryConfigOptionsTemplate', () => {\n it('generates options for SaaS', () => {\n const template = getWithSentryConfigOptionsTemplate({\n orgSlug: 'my-org',\n projectSlug: 'my-project',\n selfHosted: false,\n sentryUrl: 'https://dont-use-this-url.com',\n tunnelRoute: true,\n reactComponentAnnotation: false,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"{\n // For all available options, see:\n // https://www.npmjs.com/package/@sentry/webpack-plugin#options\n\n org: \"my-org\",\n project: \"my-project\",\n\n // Only print logs for uploading source maps in CI\n silent: !process.env.CI,\n\n // For all available options, see:\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/\n\n // Upload a larger set of source maps for prettier stack traces (increases build time)\n widenClientFileUpload: true,\n\n // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n tunnelRoute: \"/monitoring\",\n\n // Automatically tree-shake Sentry logger statements to reduce bundle size\n disableLogger: true,\n\n // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)\n // See the following for more information:\n // https://docs.sentry.io/product/crons/\n // https://vercel.com/docs/cron-jobs\n automaticVercelMonitors: true,\n }\"\n `);\n });\n\n it('generates options for self-hosted', () => {\n const template = getWithSentryConfigOptionsTemplate({\n orgSlug: 'my-org',\n projectSlug: 'my-project',\n selfHosted: true,\n sentryUrl: 'https://my-sentry.com',\n tunnelRoute: true,\n reactComponentAnnotation: false,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"{\n // For all available options, see:\n // https://www.npmjs.com/package/@sentry/webpack-plugin#options\n\n org: \"my-org\",\n project: \"my-project\",\n sentryUrl: \"https://my-sentry.com\",\n\n // Only print logs for uploading source maps in CI\n silent: !process.env.CI,\n\n // For all available options, see:\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/\n\n // Upload a larger set of source maps for prettier stack traces (increases build time)\n widenClientFileUpload: true,\n\n // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n tunnelRoute: \"/monitoring\",\n\n // Automatically tree-shake Sentry logger statements to reduce bundle size\n disableLogger: true,\n\n // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)\n // See the following for more information:\n // https://docs.sentry.io/product/crons/\n // https://vercel.com/docs/cron-jobs\n automaticVercelMonitors: true,\n }\"\n `);\n });\n\n it('comments out tunnelRoute if `tunnelRoute` option is disabled', () => {\n const template = getWithSentryConfigOptionsTemplate({\n orgSlug: 'my-org',\n projectSlug: 'my-project',\n selfHosted: false,\n sentryUrl: 'https://dont-use-this-url.com',\n tunnelRoute: false,\n reactComponentAnnotation: false,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"{\n // For all available options, see:\n // https://www.npmjs.com/package/@sentry/webpack-plugin#options\n\n org: \"my-org\",\n project: \"my-project\",\n\n // Only print logs for uploading source maps in CI\n silent: !process.env.CI,\n\n // For all available options, see:\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/\n\n // Upload a larger set of source maps for prettier stack traces (increases build time)\n widenClientFileUpload: true,\n\n // Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n // tunnelRoute: \"/monitoring\",\n\n // Automatically tree-shake Sentry logger statements to reduce bundle size\n disableLogger: true,\n\n // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)\n // See the following for more information:\n // https://docs.sentry.io/product/crons/\n // https://vercel.com/docs/cron-jobs\n automaticVercelMonitors: true,\n }\"\n `);\n });\n\n it('adds `reactComponentAnnotations` option if `reactComponentAnnotations` is enabled', () => {\n const template = getWithSentryConfigOptionsTemplate({\n orgSlug: 'my-org',\n projectSlug: 'my-project',\n selfHosted: false,\n sentryUrl: 'https://dont-use-this-url.com',\n tunnelRoute: true,\n reactComponentAnnotation: true,\n });\n\n expect(template).toMatchInlineSnapshot(`\n \"{\n // For all available options, see:\n // https://www.npmjs.com/package/@sentry/webpack-plugin#options\n\n org: \"my-org\",\n project: \"my-project\",\n\n // Only print logs for uploading source maps in CI\n silent: !process.env.CI,\n\n // For all available options, see:\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/\n\n // Upload a larger set of source maps for prettier stack traces (increases build time)\n widenClientFileUpload: true,\n\n // Automatically annotate React components to show their full name in breadcrumbs and session replay\n reactComponentAnnotation: {\n enabled: true,\n },\n\n // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.\n // This can increase your server load as well as your hosting bill.\n // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-\n // side errors will fail.\n tunnelRoute: \"/monitoring\",\n\n // Automatically tree-shake Sentry logger statements to reduce bundle size\n disableLogger: true,\n\n // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)\n // See the following for more information:\n // https://docs.sentry.io/product/crons/\n // https://vercel.com/docs/cron-jobs\n automaticVercelMonitors: true,\n }\"\n `);\n });\n });\n});\n"]}
|
|
@@ -22,12 +22,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
const clack_utils_1 = require("../../src/utils/clack-utils");
|
|
27
30
|
const fs = __importStar(require("node:fs"));
|
|
28
31
|
const ChildProcess = __importStar(require("node:child_process"));
|
|
32
|
+
const axios_1 = __importDefault(require("axios"));
|
|
29
33
|
// @ts-ignore - clack is ESM and TS complains about that. It works though
|
|
30
34
|
const clack = __importStar(require("@clack/prompts"));
|
|
35
|
+
const Sentry = __importStar(require("@sentry/node"));
|
|
31
36
|
jest.mock('node:child_process', () => ({
|
|
32
37
|
__esModule: true,
|
|
33
38
|
...jest.requireActual('node:child_process'),
|
|
@@ -37,7 +42,9 @@ jest.mock('@clack/prompts', () => ({
|
|
|
37
42
|
info: jest.fn(),
|
|
38
43
|
success: jest.fn(),
|
|
39
44
|
warn: jest.fn(),
|
|
45
|
+
error: jest.fn(),
|
|
40
46
|
},
|
|
47
|
+
outro: jest.fn(),
|
|
41
48
|
text: jest.fn(),
|
|
42
49
|
confirm: jest.fn(),
|
|
43
50
|
cancel: jest.fn(),
|
|
@@ -47,6 +54,10 @@ jest.mock('@clack/prompts', () => ({
|
|
|
47
54
|
.fn()
|
|
48
55
|
.mockImplementation(() => ({ start: jest.fn(), stop: jest.fn() })),
|
|
49
56
|
}));
|
|
57
|
+
const clackMock = clack;
|
|
58
|
+
jest.mock('axios');
|
|
59
|
+
const mockedAxios = axios_1.default;
|
|
60
|
+
jest.mock('opn', () => jest.fn(() => Promise.resolve({ on: jest.fn() })));
|
|
50
61
|
function mockUserResponse(fn, response) {
|
|
51
62
|
fn.mockReturnValueOnce(response);
|
|
52
63
|
}
|
|
@@ -181,4 +192,98 @@ describe('installPackage', () => {
|
|
|
181
192
|
expect(execSpy).toHaveBeenCalledWith('npm install @sentry/sveltekit ', expect.any(Function));
|
|
182
193
|
});
|
|
183
194
|
});
|
|
195
|
+
describe('askForWizardLogin', () => {
|
|
196
|
+
// mock axios
|
|
197
|
+
afterEach(() => {
|
|
198
|
+
// clackMock.confirm.mockClear();
|
|
199
|
+
// mockUserResponse(clack.confirm as jest.Mock, undefined);
|
|
200
|
+
});
|
|
201
|
+
beforeEach(() => {
|
|
202
|
+
jest.clearAllMocks();
|
|
203
|
+
mockedAxios.get.mockClear();
|
|
204
|
+
clackMock.confirm.mockClear();
|
|
205
|
+
clackMock.confirm.mockReset();
|
|
206
|
+
mockUserResponse(clack.confirm, undefined);
|
|
207
|
+
});
|
|
208
|
+
it('asks if a user already has a Sentry account by default', async () => {
|
|
209
|
+
mockUserResponse(clack.confirm, Promise.resolve(true));
|
|
210
|
+
// Provide the data object to be returned
|
|
211
|
+
mockedAxios.get.mockResolvedValue({
|
|
212
|
+
data: {
|
|
213
|
+
hash: 'mockedHash',
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
await (0, clack_utils_1.askForWizardLogin)({ url: 'https://santry.io/' });
|
|
217
|
+
expect(clack.confirm).toHaveBeenCalledWith(expect.objectContaining({
|
|
218
|
+
message: expect.stringContaining('already have a Sentry account'),
|
|
219
|
+
}));
|
|
220
|
+
});
|
|
221
|
+
it('skips asking for if a user already has a Sentry account if org and project are pre-selected', async () => {
|
|
222
|
+
mockUserResponse(clackMock.confirm, Promise.resolve(true));
|
|
223
|
+
// Provide the data object to be returned
|
|
224
|
+
mockedAxios.get.mockResolvedValue({
|
|
225
|
+
data: {
|
|
226
|
+
hash: 'mockedHash',
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
await (0, clack_utils_1.askForWizardLogin)({
|
|
230
|
+
url: 'https://santry.io/',
|
|
231
|
+
orgSlug: 'my-org',
|
|
232
|
+
projectSlug: 'my-project',
|
|
233
|
+
});
|
|
234
|
+
expect(clack.confirm).not.toHaveBeenCalled();
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
describe('abort', () => {
|
|
238
|
+
const sentryTxn = {
|
|
239
|
+
setStatus: jest.fn(),
|
|
240
|
+
finish: jest.fn(),
|
|
241
|
+
};
|
|
242
|
+
let sentrySession = {
|
|
243
|
+
status: 999,
|
|
244
|
+
};
|
|
245
|
+
beforeEach(() => {
|
|
246
|
+
jest.clearAllMocks();
|
|
247
|
+
sentrySession = {
|
|
248
|
+
status: 999,
|
|
249
|
+
};
|
|
250
|
+
});
|
|
251
|
+
jest.spyOn(Sentry, 'getCurrentHub').mockReturnValue({
|
|
252
|
+
getScope: () => ({
|
|
253
|
+
// @ts-expect-error - don't care about the rest of the required props value
|
|
254
|
+
getTransaction: () => sentryTxn,
|
|
255
|
+
// @ts-expect-error - don't care about the rest of the required props value
|
|
256
|
+
getSession: () => sentrySession,
|
|
257
|
+
}),
|
|
258
|
+
captureSession: jest.fn(),
|
|
259
|
+
});
|
|
260
|
+
const flushSpy = jest.fn();
|
|
261
|
+
jest.spyOn(Sentry, 'flush').mockImplementation(flushSpy);
|
|
262
|
+
it('ends the process with an error exit code by default', async () => {
|
|
263
|
+
// @ts-ignore - jest doesn't like the empty function
|
|
264
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
265
|
+
const exitSpy = jest.spyOn(process, 'exit').mockImplementation(() => { });
|
|
266
|
+
await (0, clack_utils_1.abort)();
|
|
267
|
+
expect(exitSpy).toHaveBeenCalledWith(1);
|
|
268
|
+
expect(clackMock.outro).toHaveBeenCalledTimes(1);
|
|
269
|
+
expect(clackMock.outro).toHaveBeenCalledWith('Wizard setup cancelled.');
|
|
270
|
+
expect(sentryTxn.setStatus).toHaveBeenLastCalledWith('aborted');
|
|
271
|
+
expect(sentryTxn.finish).toHaveBeenCalledTimes(1);
|
|
272
|
+
expect(sentrySession.status).toBe('crashed');
|
|
273
|
+
expect(flushSpy).toHaveBeenLastCalledWith(3000);
|
|
274
|
+
});
|
|
275
|
+
it('ends the process with a custom exit code and message if provided', async () => {
|
|
276
|
+
// @ts-ignore - jest doesn't like the empty function
|
|
277
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
278
|
+
const exitSpy = jest.spyOn(process, 'exit').mockImplementation(() => { });
|
|
279
|
+
await (0, clack_utils_1.abort)('Bye', 0);
|
|
280
|
+
expect(exitSpy).toHaveBeenCalledWith(0);
|
|
281
|
+
expect(clackMock.outro).toHaveBeenCalledTimes(1);
|
|
282
|
+
expect(clackMock.outro).toHaveBeenCalledWith('Bye');
|
|
283
|
+
expect(sentryTxn.setStatus).toHaveBeenLastCalledWith('cancelled');
|
|
284
|
+
expect(sentryTxn.finish).toHaveBeenCalledTimes(1);
|
|
285
|
+
expect(sentrySession.status).toBe('abnormal');
|
|
286
|
+
expect(flushSpy).toHaveBeenLastCalledWith(3000);
|
|
287
|
+
});
|
|
288
|
+
});
|
|
184
289
|
//# sourceMappingURL=clack-utils.test.js.map
|