@sentry/wizard 4.5.0 → 4.7.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 +25 -1
- package/README.md +23 -19
- package/dist/bin.js +22 -0
- package/dist/bin.js.map +1 -1
- package/dist/e2e-tests/tests/flutter.test.js +16 -16
- package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
- package/dist/e2e-tests/tests/help-message.test.js +56 -0
- package/dist/e2e-tests/tests/help-message.test.js.map +1 -0
- package/dist/e2e-tests/tests/nextjs-14.test.js +17 -16
- package/dist/e2e-tests/tests/nextjs-14.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs-15.test.js +16 -16
- package/dist/e2e-tests/tests/nextjs-15.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-3.test.js +13 -12
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js +13 -12
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
- package/dist/e2e-tests/tests/remix.test.js +20 -20
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit.test.js +20 -20
- package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
- package/dist/e2e-tests/utils/index.d.ts +1 -1
- package/dist/e2e-tests/utils/index.js +35 -13
- package/dist/e2e-tests/utils/index.js.map +1 -1
- package/dist/lib/Constants.d.ts +7 -1
- package/dist/lib/Constants.js.map +1 -1
- package/dist/lib/Helper/File.d.ts +1 -1
- package/dist/lib/Helper/File.js +1 -3
- package/dist/lib/Helper/File.js.map +1 -1
- package/dist/lib/Helper/Logging.d.ts +4 -1
- package/dist/lib/Helper/Logging.js +3 -0
- package/dist/lib/Helper/Logging.js.map +1 -1
- package/dist/lib/Helper/Package.d.ts +5 -3
- package/dist/lib/Helper/Package.js +2 -2
- package/dist/lib/Helper/Package.js.map +1 -1
- package/dist/lib/Helper/SentryCli.d.ts +20 -7
- package/dist/lib/Helper/SentryCli.js +21 -13
- package/dist/lib/Helper/SentryCli.js.map +1 -1
- package/dist/lib/Helper/Wizard.js +9 -5
- package/dist/lib/Helper/Wizard.js.map +1 -1
- package/dist/lib/Helper/__tests__/File.js +9 -9
- package/dist/lib/Helper/__tests__/File.js.map +1 -1
- package/dist/lib/Helper/__tests__/MergeConfig.js +17 -17
- package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/__tests__/SentryCli.js +39 -21
- package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
- package/dist/lib/Setup.d.ts +4 -1
- package/dist/lib/Setup.js +12 -2
- package/dist/lib/Setup.js.map +1 -1
- package/dist/lib/Steps/BaseStep.d.ts +1 -1
- package/dist/lib/Steps/BaseStep.js.map +1 -1
- package/dist/lib/Steps/Integrations/BaseIntegration.js +1 -2
- package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
- package/dist/lib/Steps/Integrations/Cordova.js +14 -10
- package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
- package/dist/lib/Steps/Integrations/Electron.d.ts +4 -1
- package/dist/lib/Steps/Integrations/Electron.js +1 -1
- package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.d.ts +3 -1
- package/dist/lib/Steps/Integrations/MobileProject.js +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
- package/dist/lib/Steps/PromptForParameters.d.ts +4 -1
- package/dist/lib/Steps/PromptForParameters.js.map +1 -1
- package/dist/lib/Steps/SentryProjectSelector.d.ts +42 -1
- package/dist/lib/Steps/SentryProjectSelector.js +1 -1
- package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
- package/dist/lib/Steps/WaitForSentry.d.ts +3 -1
- package/dist/lib/Steps/WaitForSentry.js +4 -4
- package/dist/lib/Steps/WaitForSentry.js.map +1 -1
- package/dist/lib/Steps/Welcome.js +5 -0
- package/dist/lib/Steps/Welcome.js.map +1 -1
- package/dist/lib/Types.d.ts +14 -0
- package/dist/lib/Types.js +3 -0
- package/dist/lib/Types.js.map +1 -0
- package/dist/lib/__tests__/Env.js +10 -16
- package/dist/lib/__tests__/Env.js.map +1 -1
- package/dist/src/android/android-wizard.js +15 -12
- package/dist/src/android/android-wizard.js.map +1 -1
- package/dist/src/android/code-tools.js +1 -1
- package/dist/src/android/code-tools.js.map +1 -1
- package/dist/src/android/gradle.js +4 -4
- package/dist/src/android/gradle.js.map +1 -1
- package/dist/src/android/manifest.js +1 -1
- package/dist/src/android/manifest.js.map +1 -1
- package/dist/src/apple/apple-wizard.d.ts +2 -2
- package/dist/src/apple/apple-wizard.js +54 -175
- package/dist/src/apple/apple-wizard.js.map +1 -1
- package/dist/src/apple/check-installed-cli.d.ts +1 -0
- package/dist/src/apple/check-installed-cli.js +60 -0
- package/dist/src/apple/check-installed-cli.js.map +1 -0
- package/dist/src/apple/cocoapod.js +1 -1
- package/dist/src/apple/cocoapod.js.map +1 -1
- package/dist/src/apple/code-tools.js +1 -1
- package/dist/src/apple/code-tools.js.map +1 -1
- package/dist/src/apple/configure-fastlane.d.ts +5 -0
- package/dist/src/apple/configure-fastlane.js +66 -0
- package/dist/src/apple/configure-fastlane.js.map +1 -0
- package/dist/src/apple/configure-package-manager.d.ts +5 -0
- package/dist/src/apple/configure-package-manager.js +68 -0
- package/dist/src/apple/configure-package-manager.js.map +1 -0
- package/dist/src/apple/configure-sentry-cli.d.ts +4 -0
- package/dist/src/apple/configure-sentry-cli.js +47 -0
- package/dist/src/apple/configure-sentry-cli.js.map +1 -0
- package/dist/src/apple/configure-xcode-project.d.ts +8 -0
- package/dist/src/apple/configure-xcode-project.js +11 -0
- package/dist/src/apple/configure-xcode-project.js.map +1 -0
- package/dist/src/apple/fastlane.d.ts +1 -1
- package/dist/src/apple/fastlane.js +5 -5
- package/dist/src/apple/fastlane.js.map +1 -1
- package/dist/src/apple/inject-code-snippet.d.ts +6 -0
- package/dist/src/apple/inject-code-snippet.js +54 -0
- package/dist/src/apple/inject-code-snippet.js.map +1 -0
- package/dist/src/apple/lookup-xcode-project.d.ts +7 -0
- package/dist/src/apple/lookup-xcode-project.js +98 -0
- package/dist/src/apple/lookup-xcode-project.js.map +1 -0
- package/dist/src/apple/options.d.ts +4 -0
- package/dist/src/apple/options.js +3 -0
- package/dist/src/apple/options.js.map +1 -0
- package/dist/src/apple/search-xcode-project-at-path.d.ts +1 -0
- package/dist/src/apple/search-xcode-project-at-path.js +70 -0
- package/dist/src/apple/search-xcode-project-at-path.js.map +1 -0
- package/dist/src/apple/templates.js +11 -7
- package/dist/src/apple/templates.js.map +1 -1
- package/dist/src/apple/xcode-manager.js +4 -7
- package/dist/src/apple/xcode-manager.js.map +1 -1
- package/dist/src/flutter/code-tools.js +3 -3
- package/dist/src/flutter/code-tools.js.map +1 -1
- package/dist/src/flutter/flutter-wizard.js +21 -15
- package/dist/src/flutter/flutter-wizard.js.map +1 -1
- package/dist/src/flutter/templates.js +4 -4
- package/dist/src/flutter/templates.js.map +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +118 -43
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nextjs/templates.d.ts +10 -1
- package/dist/src/nextjs/templates.js +192 -62
- package/dist/src/nextjs/templates.js.map +1 -1
- package/dist/src/nuxt/nuxt-wizard.js +21 -16
- package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
- package/dist/src/nuxt/sdk-example.js +3 -3
- package/dist/src/nuxt/sdk-example.js.map +1 -1
- package/dist/src/nuxt/sdk-setup.js +9 -9
- package/dist/src/nuxt/sdk-setup.js.map +1 -1
- package/dist/src/nuxt/templates.js +173 -58
- package/dist/src/nuxt/templates.js.map +1 -1
- package/dist/src/nuxt/utils.js +6 -3
- package/dist/src/nuxt/utils.js.map +1 -1
- package/dist/src/react-native/expo-env-file.js +1 -1
- package/dist/src/react-native/expo-env-file.js.map +1 -1
- package/dist/src/react-native/expo-metro.js +4 -4
- package/dist/src/react-native/expo-metro.js.map +1 -1
- package/dist/src/react-native/expo.js +4 -4
- package/dist/src/react-native/expo.js.map +1 -1
- package/dist/src/react-native/javascript.d.ts +6 -4
- package/dist/src/react-native/javascript.js +31 -15
- package/dist/src/react-native/javascript.js.map +1 -1
- package/dist/src/react-native/metro.js +8 -8
- package/dist/src/react-native/metro.js.map +1 -1
- package/dist/src/react-native/react-native-wizard.d.ts +5 -1
- package/dist/src/react-native/react-native-wizard.js +66 -36
- package/dist/src/react-native/react-native-wizard.js.map +1 -1
- package/dist/src/react-native/uninstall.js +8 -5
- package/dist/src/react-native/uninstall.js.map +1 -1
- package/dist/src/react-native/xcode.d.ts +9 -4
- package/dist/src/react-native/xcode.js +65 -22
- package/dist/src/react-native/xcode.js.map +1 -1
- package/dist/src/remix/codemods/handle-error.js +4 -1
- package/dist/src/remix/codemods/handle-error.js.map +1 -1
- package/dist/src/remix/remix-wizard.js +23 -18
- package/dist/src/remix/remix-wizard.js.map +1 -1
- package/dist/src/remix/sdk-example.js +163 -64
- package/dist/src/remix/sdk-example.js.map +1 -1
- package/dist/src/remix/sdk-setup.js +11 -7
- package/dist/src/remix/sdk-setup.js.map +1 -1
- package/dist/src/run.d.ts +3 -1
- package/dist/src/run.js +29 -9
- package/dist/src/run.js.map +1 -1
- package/dist/src/sourcemaps/sourcemaps-wizard.js +30 -28
- package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
- package/dist/src/sourcemaps/tools/angular.js +3 -3
- package/dist/src/sourcemaps/tools/angular.js.map +1 -1
- package/dist/src/sourcemaps/tools/create-react-app.js +3 -3
- package/dist/src/sourcemaps/tools/create-react-app.js.map +1 -1
- package/dist/src/sourcemaps/tools/esbuild.js +6 -6
- package/dist/src/sourcemaps/tools/esbuild.js.map +1 -1
- package/dist/src/sourcemaps/tools/nextjs.js +5 -5
- package/dist/src/sourcemaps/tools/nextjs.js.map +1 -1
- package/dist/src/sourcemaps/tools/remix.js +4 -4
- package/dist/src/sourcemaps/tools/remix.js.map +1 -1
- package/dist/src/sourcemaps/tools/rollup.js +6 -6
- package/dist/src/sourcemaps/tools/rollup.js.map +1 -1
- package/dist/src/sourcemaps/tools/sentry-cli.js +15 -15
- package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
- package/dist/src/sourcemaps/tools/tsc.js +6 -6
- package/dist/src/sourcemaps/tools/tsc.js.map +1 -1
- package/dist/src/sourcemaps/tools/vite.js +12 -12
- package/dist/src/sourcemaps/tools/vite.js.map +1 -1
- package/dist/src/sourcemaps/tools/webpack.js +10 -10
- package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
- package/dist/src/sourcemaps/utils/detect-tool.js +2 -2
- package/dist/src/sourcemaps/utils/detect-tool.js.map +1 -1
- package/dist/src/sourcemaps/utils/other-wizards.js +5 -5
- package/dist/src/sourcemaps/utils/other-wizards.js.map +1 -1
- package/dist/src/sourcemaps/utils/sdk-version.js +7 -7
- package/dist/src/sourcemaps/utils/sdk-version.js.map +1 -1
- package/dist/src/sveltekit/sdk-example.js +1 -1
- package/dist/src/sveltekit/sdk-example.js.map +1 -1
- package/dist/src/sveltekit/sdk-setup.js +15 -14
- package/dist/src/sveltekit/sdk-setup.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +25 -20
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/src/sveltekit/templates.js +126 -37
- package/dist/src/sveltekit/templates.js.map +1 -1
- package/dist/src/telemetry.js +11 -0
- package/dist/src/telemetry.js.map +1 -1
- package/dist/src/utils/{clack-utils.d.ts → clack/index.d.ts} +45 -7
- package/dist/src/utils/{clack-utils.js → clack/index.js} +75 -20
- package/dist/src/utils/clack/index.js.map +1 -0
- package/dist/src/utils/debug.js +1 -1
- package/dist/src/utils/debug.js.map +1 -1
- package/dist/src/utils/find-files-with-extension.d.ts +1 -0
- package/dist/src/utils/find-files-with-extension.js +39 -0
- package/dist/src/utils/find-files-with-extension.js.map +1 -0
- package/dist/src/utils/package-manager.d.ts +8 -1
- package/dist/src/utils/package-manager.js +79 -23
- package/dist/src/utils/package-manager.js.map +1 -1
- package/dist/src/utils/sentrycli-utils.js +0 -1
- package/dist/src/utils/sentrycli-utils.js.map +1 -1
- package/dist/src/utils/types.d.ts +4 -0
- package/dist/src/utils/types.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/test/android/code-tools.test.js +13 -13
- package/dist/test/android/code-tools.test.js.map +1 -1
- package/dist/test/apple/cocoapod.test.js +78 -73
- package/dist/test/apple/cocoapod.test.js.map +1 -1
- package/dist/test/apple/code-tools.test.js +174 -167
- package/dist/test/apple/code-tools.test.js.map +1 -1
- package/dist/test/apple/fastfile.test.js +87 -84
- package/dist/test/apple/fastfile.test.js.map +1 -1
- package/dist/test/apple/templates.test.js +32 -27
- package/dist/test/apple/templates.test.js.map +1 -1
- package/dist/test/apple/xcode-manager.test.js +208 -185
- package/dist/test/apple/xcode-manager.test.js.map +1 -1
- package/dist/test/flutter/code-tools.test.js +29 -30
- package/dist/test/flutter/code-tools.test.js.map +1 -1
- package/dist/test/flutter/templates.test.js +38 -37
- package/dist/test/flutter/templates.test.js.map +1 -1
- package/dist/test/nextjs/templates.test.js +155 -103
- package/dist/test/nextjs/templates.test.js.map +1 -1
- package/dist/test/nuxt/templates.test.js +25 -24
- package/dist/test/nuxt/templates.test.js.map +1 -1
- package/dist/test/react-native/expo-metro.test.js +12 -11
- package/dist/test/react-native/expo-metro.test.js.map +1 -1
- package/dist/test/react-native/expo.test.js +11 -10
- package/dist/test/react-native/expo.test.js.map +1 -1
- package/dist/test/react-native/gradle.test.js +27 -26
- package/dist/test/react-native/gradle.test.js.map +1 -1
- package/dist/test/react-native/javascript.test.js +109 -59
- package/dist/test/react-native/javascript.test.js.map +1 -1
- package/dist/test/react-native/metro.test.js +66 -65
- package/dist/test/react-native/metro.test.js.map +1 -1
- package/dist/test/react-native/xcode.test.js +138 -37
- package/dist/test/react-native/xcode.test.js.map +1 -1
- package/dist/test/remix/client-entry.test.js +8 -7
- package/dist/test/remix/client-entry.test.js.map +1 -1
- package/dist/test/remix/server-instrumentation.test.js +6 -5
- package/dist/test/remix/server-instrumentation.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/sentry-cli.test.js +21 -21
- package/dist/test/sourcemaps/tools/sentry-cli.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/tsc.test.js +13 -14
- package/dist/test/sourcemaps/tools/tsc.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/vite.test.js +13 -14
- package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/webpack.test.js +19 -20
- package/dist/test/sourcemaps/tools/webpack.test.js.map +1 -1
- package/dist/test/sveltekit/templates.test.js +13 -12
- package/dist/test/sveltekit/templates.test.js.map +1 -1
- package/dist/test/utils/ast-utils.test.js +45 -44
- package/dist/test/utils/ast-utils.test.js.map +1 -1
- package/dist/test/utils/clack/index.test.d.ts +1 -0
- package/dist/test/utils/clack/index.test.js +375 -0
- package/dist/test/utils/clack/index.test.js.map +1 -0
- package/dist/test/utils/package-manager.test.d.ts +1 -0
- package/dist/test/utils/package-manager.test.js +30 -0
- package/dist/test/utils/package-manager.test.js.map +1 -0
- package/package.json +10 -38
- package/dist/e2e-tests/jest.config.d.ts +0 -17
- package/dist/e2e-tests/jest.config.js +0 -23
- package/dist/e2e-tests/jest.config.js.map +0 -1
- package/dist/src/utils/clack-utils.js.map +0 -1
- package/dist/test/utils/clack-utils.test.js +0 -306
- package/dist/test/utils/clack-utils.test.js.map +0 -1
- /package/dist/{test/utils/clack-utils.test.d.ts → e2e-tests/tests/help-message.test.d.ts} +0 -0
|
@@ -28,18 +28,19 @@ const os = __importStar(require("node:os"));
|
|
|
28
28
|
const path = __importStar(require("node:path"));
|
|
29
29
|
const templates_1 = require("../../src/apple/templates");
|
|
30
30
|
const xcode_manager_1 = require("../../src/apple/xcode-manager");
|
|
31
|
-
|
|
31
|
+
const vitest_1 = require("vitest");
|
|
32
|
+
vitest_1.vi.mock('node:fs', async () => ({
|
|
32
33
|
__esModule: true,
|
|
33
|
-
...
|
|
34
|
+
...(await vitest_1.vi.importActual('node:fs')),
|
|
34
35
|
}));
|
|
35
|
-
|
|
36
|
+
vitest_1.vi.mock('@clack/prompts', () => ({
|
|
36
37
|
log: {
|
|
37
|
-
info:
|
|
38
|
-
success:
|
|
39
|
-
step:
|
|
38
|
+
info: vitest_1.vi.fn(),
|
|
39
|
+
success: vitest_1.vi.fn(),
|
|
40
|
+
step: vitest_1.vi.fn(),
|
|
40
41
|
},
|
|
41
42
|
}));
|
|
42
|
-
const appleProjectsPath = path.resolve(__dirname, '../../
|
|
43
|
+
const appleProjectsPath = path.resolve(__dirname, '../../fixtures/test-applications/apple');
|
|
43
44
|
const damagedProjectPath = path.join(appleProjectsPath, 'damaged-missing-configuration-list/Project.xcodeproj/project.pbxproj');
|
|
44
45
|
const noTargetsProjectPath = path.join(appleProjectsPath, 'no-targets/Project.xcodeproj/project.pbxproj');
|
|
45
46
|
const singleTargetProjectPath = path.join(appleProjectsPath, 'spm-swiftui-single-target/Project.xcodeproj/project.pbxproj');
|
|
@@ -54,65 +55,65 @@ const projectData = {
|
|
|
54
55
|
},
|
|
55
56
|
keys: [{ dsn: { public: 'https://sentry.io/1234567890' } }],
|
|
56
57
|
};
|
|
57
|
-
describe('XcodeManager', () => {
|
|
58
|
-
afterEach(() => {
|
|
59
|
-
|
|
58
|
+
(0, vitest_1.describe)('XcodeManager', () => {
|
|
59
|
+
(0, vitest_1.afterEach)(() => {
|
|
60
|
+
vitest_1.vi.clearAllMocks();
|
|
60
61
|
});
|
|
61
|
-
describe('XcodeProject', () => {
|
|
62
|
-
describe('getAllTargets', () => {
|
|
63
|
-
describe('single target', () => {
|
|
64
|
-
it('should return all targets', () => {
|
|
62
|
+
(0, vitest_1.describe)('XcodeProject', () => {
|
|
63
|
+
(0, vitest_1.describe)('getAllTargets', () => {
|
|
64
|
+
(0, vitest_1.describe)('single target', () => {
|
|
65
|
+
(0, vitest_1.it)('should return all targets', () => {
|
|
65
66
|
// -- Arrange --
|
|
66
67
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
67
68
|
// -- Act --
|
|
68
69
|
const targets = xcodeProject.getAllTargets();
|
|
69
70
|
// -- Assert --
|
|
70
|
-
expect(targets).toEqual(['Project']);
|
|
71
|
+
(0, vitest_1.expect)(targets).toEqual(['Project']);
|
|
71
72
|
});
|
|
72
73
|
});
|
|
73
|
-
describe('multiple targets', () => {
|
|
74
|
-
it('should return all targets', () => {
|
|
74
|
+
(0, vitest_1.describe)('multiple targets', () => {
|
|
75
|
+
(0, vitest_1.it)('should return all targets', () => {
|
|
75
76
|
// -- Arrange --
|
|
76
77
|
const xcodeProject = new xcode_manager_1.XcodeProject(multiTargetProjectPath);
|
|
77
78
|
// -- Act --
|
|
78
79
|
const targets = xcodeProject.getAllTargets();
|
|
79
80
|
// -- Assert --
|
|
80
|
-
expect(targets).toEqual(['Project1', 'Project2']);
|
|
81
|
+
(0, vitest_1.expect)(targets).toEqual(['Project1', 'Project2']);
|
|
81
82
|
});
|
|
82
83
|
});
|
|
83
|
-
describe('no targets', () => {
|
|
84
|
-
it('should return an empty array', () => {
|
|
84
|
+
(0, vitest_1.describe)('no targets', () => {
|
|
85
|
+
(0, vitest_1.it)('should return an empty array', () => {
|
|
85
86
|
// -- Arrange --
|
|
86
87
|
const xcodeProject = new xcode_manager_1.XcodeProject(noTargetsProjectPath);
|
|
87
88
|
// -- Act --
|
|
88
89
|
const targets = xcodeProject.getAllTargets();
|
|
89
90
|
// -- Assert --
|
|
90
|
-
expect(targets).toEqual([]);
|
|
91
|
+
(0, vitest_1.expect)(targets).toEqual([]);
|
|
91
92
|
});
|
|
92
93
|
});
|
|
93
|
-
describe('project with missing configuration list', () => {
|
|
94
|
-
it('should return an empty array', () => {
|
|
94
|
+
(0, vitest_1.describe)('project with missing configuration list', () => {
|
|
95
|
+
(0, vitest_1.it)('should return an empty array', () => {
|
|
95
96
|
// -- Arrange --
|
|
96
97
|
const xcodeProject = new xcode_manager_1.XcodeProject(damagedProjectPath);
|
|
97
98
|
// -- Act --
|
|
98
99
|
const targets = xcodeProject.getAllTargets();
|
|
99
100
|
// -- Assert --
|
|
100
|
-
expect(targets).toEqual([]);
|
|
101
|
+
(0, vitest_1.expect)(targets).toEqual([]);
|
|
101
102
|
});
|
|
102
103
|
});
|
|
103
104
|
});
|
|
104
|
-
describe('updateXcodeProject', () => {
|
|
105
|
+
(0, vitest_1.describe)('updateXcodeProject', () => {
|
|
105
106
|
let sourceProjectPath;
|
|
106
107
|
let tempProjectPath;
|
|
107
108
|
let xcodeProject;
|
|
108
|
-
beforeEach(() => {
|
|
109
|
+
(0, vitest_1.beforeEach)(() => {
|
|
109
110
|
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'update-xcode-project'));
|
|
110
111
|
sourceProjectPath = singleTargetProjectPath;
|
|
111
112
|
tempProjectPath = path.resolve(tempDir, 'project.pbxproj');
|
|
112
113
|
fs.copyFileSync(sourceProjectPath, tempProjectPath);
|
|
113
114
|
xcodeProject = new xcode_manager_1.XcodeProject(tempProjectPath);
|
|
114
115
|
});
|
|
115
|
-
describe('upload symbols script', () => {
|
|
116
|
+
(0, vitest_1.describe)('upload symbols script', () => {
|
|
116
117
|
const scriptVariants = [
|
|
117
118
|
{
|
|
118
119
|
uploadSource: true,
|
|
@@ -132,16 +133,14 @@ describe('XcodeManager', () => {
|
|
|
132
133
|
},
|
|
133
134
|
];
|
|
134
135
|
for (const variant of scriptVariants) {
|
|
135
|
-
describe(`upload source = ${variant.uploadSource?.toString()} and include homebrew path = ${variant.includeHomebrewPath.toString()}`, () => {
|
|
136
|
-
beforeEach(() => {
|
|
137
|
-
|
|
138
|
-
.spyOn(fs, 'existsSync')
|
|
139
|
-
.mockReturnValue(variant.includeHomebrewPath);
|
|
136
|
+
(0, vitest_1.describe)(`upload source = ${variant.uploadSource?.toString()} and include homebrew path = ${variant.includeHomebrewPath.toString()}`, () => {
|
|
137
|
+
(0, vitest_1.beforeEach)(() => {
|
|
138
|
+
vitest_1.vi.spyOn(fs, 'existsSync').mockReturnValue(variant.includeHomebrewPath);
|
|
140
139
|
});
|
|
141
|
-
afterEach(() => {
|
|
142
|
-
|
|
140
|
+
(0, vitest_1.afterEach)(() => {
|
|
141
|
+
vitest_1.vi.restoreAllMocks();
|
|
143
142
|
});
|
|
144
|
-
it('should add the upload symbols script to the target', () => {
|
|
143
|
+
(0, vitest_1.it)('should add the upload symbols script to the target', () => {
|
|
145
144
|
// -- Arrange --
|
|
146
145
|
const generatedShellScript = (0, templates_1.getRunScriptTemplate)(projectData.organization.slug, projectData.slug, variant.uploadSource, variant.includeHomebrewPath);
|
|
147
146
|
const expectedShellScript = `"${generatedShellScript.replace(/"/g, '\\"')}"`;
|
|
@@ -152,92 +151,92 @@ describe('XcodeManager', () => {
|
|
|
152
151
|
const updatedXcodeProject = new xcode_manager_1.XcodeProject(tempProjectPath);
|
|
153
152
|
// Expect the upload symbols script to be added
|
|
154
153
|
const scriptObjects = updatedXcodeProject.objects.PBXShellScriptBuildPhase;
|
|
155
|
-
expect(scriptObjects).toBeDefined();
|
|
154
|
+
(0, vitest_1.expect)(scriptObjects).toBeDefined();
|
|
156
155
|
if (!scriptObjects) {
|
|
157
156
|
throw new Error('Script objects not found');
|
|
158
157
|
}
|
|
159
158
|
const scriptKeys = Object.keys(scriptObjects);
|
|
160
|
-
expect(scriptKeys).toHaveLength(2);
|
|
159
|
+
(0, vitest_1.expect)(scriptKeys).toHaveLength(2);
|
|
161
160
|
// Find the script ID
|
|
162
161
|
const scriptId = scriptKeys.find((key) => !key.endsWith('_comment'));
|
|
163
|
-
expect(scriptId).toBeDefined();
|
|
162
|
+
(0, vitest_1.expect)(scriptId).toBeDefined();
|
|
164
163
|
if (!scriptId) {
|
|
165
164
|
throw new Error('Script ID not found');
|
|
166
165
|
}
|
|
167
|
-
expect(scriptId).toMatch(/^[A-F0-9]{24}$/i);
|
|
166
|
+
(0, vitest_1.expect)(scriptId).toMatch(/^[A-F0-9]{24}$/i);
|
|
168
167
|
// Expect the script to be added
|
|
169
168
|
const script = scriptObjects[scriptId];
|
|
170
|
-
expect(script).toBeDefined();
|
|
171
|
-
expect(typeof script).not.toBe('string');
|
|
172
|
-
expect(script.inputPaths).toEqual([
|
|
169
|
+
(0, vitest_1.expect)(script).toBeDefined();
|
|
170
|
+
(0, vitest_1.expect)(typeof script).not.toBe('string');
|
|
171
|
+
(0, vitest_1.expect)(script.inputPaths).toEqual([
|
|
173
172
|
'"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}"',
|
|
174
173
|
]);
|
|
175
|
-
expect(script.outputPaths).toEqual([]);
|
|
176
|
-
expect(script.shellPath).toBe('/bin/sh');
|
|
177
|
-
expect(script.shellScript).toEqual(expectedShellScript);
|
|
174
|
+
(0, vitest_1.expect)(script.outputPaths).toEqual([]);
|
|
175
|
+
(0, vitest_1.expect)(script.shellPath).toBe('/bin/sh');
|
|
176
|
+
(0, vitest_1.expect)(script.shellScript).toEqual(expectedShellScript);
|
|
178
177
|
const commentKey = `${scriptId}_comment`;
|
|
179
|
-
expect(scriptKeys).toContain(commentKey);
|
|
180
|
-
expect(scriptObjects[commentKey]).toBe('Upload Debug Symbols to Sentry');
|
|
178
|
+
(0, vitest_1.expect)(scriptKeys).toContain(commentKey);
|
|
179
|
+
(0, vitest_1.expect)(scriptObjects[commentKey]).toBe('Upload Debug Symbols to Sentry');
|
|
181
180
|
});
|
|
182
181
|
});
|
|
183
182
|
}
|
|
184
183
|
});
|
|
185
|
-
describe('debug information format and sandbox', () => {
|
|
186
|
-
describe('upload source is false', () => {
|
|
187
|
-
it('should not update the Xcode project', () => {
|
|
184
|
+
(0, vitest_1.describe)('debug information format and sandbox', () => {
|
|
185
|
+
(0, vitest_1.describe)('upload source is false', () => {
|
|
186
|
+
(0, vitest_1.it)('should not update the Xcode project', () => {
|
|
188
187
|
// -- Act --
|
|
189
188
|
xcodeProject.updateXcodeProject(projectData, 'Project', false, // Ignore SPM reference
|
|
190
189
|
false);
|
|
191
190
|
// -- Assert --
|
|
192
191
|
const expectedXcodeProject = new xcode_manager_1.XcodeProject(sourceProjectPath);
|
|
193
|
-
expect(xcodeProject.objects.XCBuildConfiguration).toEqual(expectedXcodeProject.objects.XCBuildConfiguration);
|
|
192
|
+
(0, vitest_1.expect)(xcodeProject.objects.XCBuildConfiguration).toEqual(expectedXcodeProject.objects.XCBuildConfiguration);
|
|
194
193
|
});
|
|
195
194
|
});
|
|
196
|
-
describe('upload source is true', () => {
|
|
195
|
+
(0, vitest_1.describe)('upload source is true', () => {
|
|
197
196
|
const uploadSource = true;
|
|
198
|
-
describe('named target not found', () => {
|
|
199
|
-
it('should not update the flags in the Xcode project', () => {
|
|
197
|
+
(0, vitest_1.describe)('named target not found', () => {
|
|
198
|
+
(0, vitest_1.it)('should not update the flags in the Xcode project', () => {
|
|
200
199
|
// -- Act --
|
|
201
200
|
xcodeProject.updateXcodeProject(projectData, 'Invalid Target Name', false, // Ignore SPM reference
|
|
202
201
|
uploadSource);
|
|
203
202
|
// -- Assert --
|
|
204
203
|
const originalXcodeProject = new xcode_manager_1.XcodeProject(sourceProjectPath);
|
|
205
|
-
expect(xcodeProject.objects.XCBuildConfiguration).toEqual(originalXcodeProject.objects.XCBuildConfiguration);
|
|
204
|
+
(0, vitest_1.expect)(xcodeProject.objects.XCBuildConfiguration).toEqual(originalXcodeProject.objects.XCBuildConfiguration);
|
|
206
205
|
});
|
|
207
206
|
});
|
|
208
|
-
describe('named target found', () => {
|
|
209
|
-
describe('build configurations is undefined', () => {
|
|
210
|
-
it('should not update the Xcode project', () => {
|
|
207
|
+
(0, vitest_1.describe)('named target found', () => {
|
|
208
|
+
(0, vitest_1.describe)('build configurations is undefined', () => {
|
|
209
|
+
(0, vitest_1.it)('should not update the Xcode project', () => {
|
|
211
210
|
// -- Act --
|
|
212
211
|
xcodeProject.updateXcodeProject(projectData, 'Invalid Target Name', false, // Ignore SPM reference
|
|
213
212
|
uploadSource);
|
|
214
213
|
// -- Assert --
|
|
215
214
|
const originalXcodeProject = new xcode_manager_1.XcodeProject(sourceProjectPath);
|
|
216
|
-
expect(xcodeProject.objects.XCBuildConfiguration).toEqual(originalXcodeProject.objects.XCBuildConfiguration);
|
|
215
|
+
(0, vitest_1.expect)(xcodeProject.objects.XCBuildConfiguration).toEqual(originalXcodeProject.objects.XCBuildConfiguration);
|
|
217
216
|
});
|
|
218
217
|
});
|
|
219
|
-
describe('no build configurations found', () => {
|
|
220
|
-
it('should not update the Xcode project', () => {
|
|
218
|
+
(0, vitest_1.describe)('no build configurations found', () => {
|
|
219
|
+
(0, vitest_1.it)('should not update the Xcode project', () => {
|
|
221
220
|
// -- Arrange --
|
|
222
221
|
xcodeProject.objects.XCBuildConfiguration = {};
|
|
223
222
|
// -- Act --
|
|
224
223
|
xcodeProject.updateXcodeProject(projectData, 'Invalid Target Name', false, // Ignore SPM reference
|
|
225
224
|
uploadSource);
|
|
226
225
|
// -- Assert --
|
|
227
|
-
expect(xcodeProject.objects.XCBuildConfiguration).toEqual({});
|
|
226
|
+
(0, vitest_1.expect)(xcodeProject.objects.XCBuildConfiguration).toEqual({});
|
|
228
227
|
});
|
|
229
228
|
});
|
|
230
|
-
describe('build configurations found', () => {
|
|
229
|
+
(0, vitest_1.describe)('build configurations found', () => {
|
|
231
230
|
const debugProjectBuildConfigurationListId = 'D4E604DA2D50CEEE00CAB00F';
|
|
232
231
|
const releaseProjectBuildConfigurationListId = 'D4E604DB2D50CEEE00CAB00F';
|
|
233
232
|
const debugTargetBuildConfigurationListId = 'D4E604DD2D50CEEE00CAB00F';
|
|
234
233
|
const releaseTargetBuildConfigurationListId = 'D4E604DE2D50CEEE00CAB00F';
|
|
235
|
-
it('should update the target configuration lists', () => {
|
|
234
|
+
(0, vitest_1.it)('should update the target configuration lists', () => {
|
|
236
235
|
// -- Act --
|
|
237
236
|
xcodeProject.updateXcodeProject(projectData, 'Project', false, // Ignore SPM reference
|
|
238
237
|
uploadSource);
|
|
239
238
|
// -- Assert --
|
|
240
|
-
expect(xcodeProject.objects.XCBuildConfiguration).toBeDefined();
|
|
239
|
+
(0, vitest_1.expect)(xcodeProject.objects.XCBuildConfiguration).toBeDefined();
|
|
241
240
|
// Both Debug and Release are configured equally
|
|
242
241
|
const expectedConfigKeys = [
|
|
243
242
|
debugTargetBuildConfigurationListId,
|
|
@@ -246,49 +245,50 @@ describe('XcodeManager', () => {
|
|
|
246
245
|
for (const key of expectedConfigKeys) {
|
|
247
246
|
const buildConfiguration = xcodeProject.objects
|
|
248
247
|
.XCBuildConfiguration?.[key];
|
|
249
|
-
expect(buildConfiguration).toBeDefined();
|
|
250
|
-
expect(typeof buildConfiguration).not.toBe('string');
|
|
248
|
+
(0, vitest_1.expect)(buildConfiguration).toBeDefined();
|
|
249
|
+
(0, vitest_1.expect)(typeof buildConfiguration).not.toBe('string');
|
|
251
250
|
const buildSettings = buildConfiguration.buildSettings ?? {};
|
|
252
|
-
expect(buildSettings.DEBUG_INFORMATION_FORMAT).toBe('"dwarf-with-dsym"');
|
|
253
|
-
expect(buildSettings.ENABLE_USER_SCRIPT_SANDBOXING).toBe('"NO"');
|
|
251
|
+
(0, vitest_1.expect)(buildSettings.DEBUG_INFORMATION_FORMAT).toBe('"dwarf-with-dsym"');
|
|
252
|
+
(0, vitest_1.expect)(buildSettings.ENABLE_USER_SCRIPT_SANDBOXING).toBe('"NO"');
|
|
254
253
|
}
|
|
255
254
|
});
|
|
256
|
-
it('should not update the project configuration lists', () => {
|
|
255
|
+
(0, vitest_1.it)('should not update the project configuration lists', () => {
|
|
257
256
|
// -- Act --
|
|
258
257
|
xcodeProject.updateXcodeProject(projectData, 'Project', false, // Ignore SPM reference
|
|
259
258
|
uploadSource);
|
|
260
259
|
// -- Assert --
|
|
261
|
-
expect(xcodeProject.objects.XCBuildConfiguration).toBeDefined();
|
|
260
|
+
(0, vitest_1.expect)(xcodeProject.objects.XCBuildConfiguration).toBeDefined();
|
|
262
261
|
// Check project build configurations 'Debug'
|
|
263
262
|
const debugBuildConfiguration = xcodeProject.objects
|
|
264
263
|
.XCBuildConfiguration?.[debugProjectBuildConfigurationListId];
|
|
265
|
-
expect(debugBuildConfiguration).toBeDefined();
|
|
266
|
-
expect(typeof debugBuildConfiguration).not.toBe('string');
|
|
267
|
-
expect(debugBuildConfiguration.buildSettings
|
|
264
|
+
(0, vitest_1.expect)(debugBuildConfiguration).toBeDefined();
|
|
265
|
+
(0, vitest_1.expect)(typeof debugBuildConfiguration).not.toBe('string');
|
|
266
|
+
(0, vitest_1.expect)(debugBuildConfiguration.buildSettings
|
|
268
267
|
?.DEBUG_INFORMATION_FORMAT).toBe('dwarf');
|
|
269
|
-
expect(debugBuildConfiguration.buildSettings
|
|
268
|
+
(0, vitest_1.expect)(debugBuildConfiguration.buildSettings
|
|
270
269
|
?.ENABLE_USER_SCRIPT_SANDBOXING).toBe('YES');
|
|
271
270
|
// Check project build configurations 'Release'
|
|
272
271
|
const releaseBuildConfiguration = xcodeProject.objects
|
|
273
272
|
.XCBuildConfiguration?.[releaseProjectBuildConfigurationListId];
|
|
274
|
-
expect(releaseBuildConfiguration).toBeDefined();
|
|
275
|
-
expect(typeof releaseBuildConfiguration).not.toBe('string');
|
|
276
|
-
expect(releaseBuildConfiguration.buildSettings
|
|
273
|
+
(0, vitest_1.expect)(releaseBuildConfiguration).toBeDefined();
|
|
274
|
+
(0, vitest_1.expect)(typeof releaseBuildConfiguration).not.toBe('string');
|
|
275
|
+
(0, vitest_1.expect)(releaseBuildConfiguration.buildSettings
|
|
277
276
|
?.DEBUG_INFORMATION_FORMAT).toBe('"dwarf-with-dsym"');
|
|
278
|
-
expect(releaseBuildConfiguration.buildSettings
|
|
277
|
+
(0, vitest_1.expect)(releaseBuildConfiguration.buildSettings
|
|
279
278
|
?.ENABLE_USER_SCRIPT_SANDBOXING).toBe('YES');
|
|
280
279
|
});
|
|
281
280
|
});
|
|
282
281
|
});
|
|
283
282
|
});
|
|
284
283
|
});
|
|
285
|
-
describe('add SPM reference', () => {
|
|
284
|
+
(0, vitest_1.describe)('add SPM reference', () => {
|
|
286
285
|
const addSPMReference = true;
|
|
287
|
-
describe('framework build phase already contains Sentry', () => {
|
|
288
|
-
it('should not update the Xcode project', () => {
|
|
286
|
+
(0, vitest_1.describe)('framework build phase already contains Sentry', () => {
|
|
287
|
+
(0, vitest_1.it)('should not update the Xcode project', () => {
|
|
289
288
|
// -- Arrange --
|
|
290
289
|
xcodeProject.objects.PBXFrameworksBuildPhase = {
|
|
291
290
|
'framework-id': {
|
|
291
|
+
isa: 'PBXFrameworksBuildPhase',
|
|
292
292
|
files: [
|
|
293
293
|
{
|
|
294
294
|
value: '123',
|
|
@@ -303,6 +303,7 @@ describe('XcodeManager', () => {
|
|
|
303
303
|
const expectedXcodeProject = new xcode_manager_1.XcodeProject(sourceProjectPath);
|
|
304
304
|
expectedXcodeProject.objects.PBXFrameworksBuildPhase = {
|
|
305
305
|
'framework-id': {
|
|
306
|
+
isa: 'PBXFrameworksBuildPhase',
|
|
306
307
|
files: [
|
|
307
308
|
{
|
|
308
309
|
value: '123',
|
|
@@ -311,41 +312,41 @@ describe('XcodeManager', () => {
|
|
|
311
312
|
],
|
|
312
313
|
},
|
|
313
314
|
};
|
|
314
|
-
expect(xcodeProject.objects.PBXFrameworksBuildPhase).toEqual(expectedXcodeProject.objects.PBXFrameworksBuildPhase);
|
|
315
|
-
expect(xcodeProject.objects.XCRemoteSwiftPackageReference).toEqual(expectedXcodeProject.objects.XCRemoteSwiftPackageReference);
|
|
316
|
-
expect(xcodeProject.objects.XCSwiftPackageProductDependency).toEqual(expectedXcodeProject.objects.XCSwiftPackageProductDependency);
|
|
315
|
+
(0, vitest_1.expect)(xcodeProject.objects.PBXFrameworksBuildPhase).toEqual(expectedXcodeProject.objects.PBXFrameworksBuildPhase);
|
|
316
|
+
(0, vitest_1.expect)(xcodeProject.objects.XCRemoteSwiftPackageReference).toEqual(expectedXcodeProject.objects.XCRemoteSwiftPackageReference);
|
|
317
|
+
(0, vitest_1.expect)(xcodeProject.objects.XCSwiftPackageProductDependency).toEqual(expectedXcodeProject.objects.XCSwiftPackageProductDependency);
|
|
317
318
|
});
|
|
318
319
|
});
|
|
319
|
-
it('should add the SPM reference to the target', () => {
|
|
320
|
+
(0, vitest_1.it)('should add the SPM reference to the target', () => {
|
|
320
321
|
// -- Act --
|
|
321
322
|
xcodeProject.updateXcodeProject(projectData, 'Project', addSPMReference);
|
|
322
323
|
// -- Assert --
|
|
323
324
|
// Get the target
|
|
324
325
|
const target = xcodeProject.objects.PBXNativeTarget?.['D4E604CC2D50CEEC00CAB00F'];
|
|
325
|
-
expect(target).toBeDefined();
|
|
326
|
+
(0, vitest_1.expect)(target).toBeDefined();
|
|
326
327
|
if (!target) {
|
|
327
328
|
throw new Error('Target is undefined');
|
|
328
329
|
}
|
|
329
330
|
// Check the SPM dependency is added to the target
|
|
330
|
-
expect(target.packageProductDependencies).toEqual([
|
|
331
|
-
expect.objectContaining({
|
|
332
|
-
value: expect.any(String),
|
|
331
|
+
(0, vitest_1.expect)(target.packageProductDependencies).toEqual([
|
|
332
|
+
vitest_1.expect.objectContaining({
|
|
333
|
+
value: vitest_1.expect.any(String),
|
|
333
334
|
comment: 'Sentry',
|
|
334
335
|
}),
|
|
335
336
|
]);
|
|
336
337
|
// Check the SPM package reference object is added to the project
|
|
337
338
|
const remoteSwiftPackageReferences = xcodeProject.objects.XCRemoteSwiftPackageReference;
|
|
338
|
-
expect(remoteSwiftPackageReferences).toBeDefined();
|
|
339
|
+
(0, vitest_1.expect)(remoteSwiftPackageReferences).toBeDefined();
|
|
339
340
|
if (!remoteSwiftPackageReferences) {
|
|
340
341
|
throw new Error('XCRemoteSwiftPackageReference is undefined');
|
|
341
342
|
}
|
|
342
343
|
const rspRefKeys = Object.keys(remoteSwiftPackageReferences);
|
|
343
|
-
expect(rspRefKeys).toHaveLength(2);
|
|
344
|
+
(0, vitest_1.expect)(rspRefKeys).toHaveLength(2);
|
|
344
345
|
// First key is expected to be the UUID of the SPM package reference
|
|
345
|
-
expect(rspRefKeys[0]).toMatch(/^[A-F0-9]{24}$/i);
|
|
346
|
+
(0, vitest_1.expect)(rspRefKeys[0]).toMatch(/^[A-F0-9]{24}$/i);
|
|
346
347
|
// Second key is expected to be the UUID of the SPM package reference with _comment suffix
|
|
347
|
-
expect(rspRefKeys[1]).toMatch(/^[A-F0-9]{24}_comment$/i);
|
|
348
|
-
expect(remoteSwiftPackageReferences?.[rspRefKeys[0]]).toEqual({
|
|
348
|
+
(0, vitest_1.expect)(rspRefKeys[1]).toMatch(/^[A-F0-9]{24}_comment$/i);
|
|
349
|
+
(0, vitest_1.expect)(remoteSwiftPackageReferences?.[rspRefKeys[0]]).toEqual({
|
|
349
350
|
isa: 'XCRemoteSwiftPackageReference',
|
|
350
351
|
repositoryURL: '"https://github.com/getsentry/sentry-cocoa/"',
|
|
351
352
|
requirement: {
|
|
@@ -353,20 +354,20 @@ describe('XcodeManager', () => {
|
|
|
353
354
|
minimumVersion: '8.0.0',
|
|
354
355
|
},
|
|
355
356
|
});
|
|
356
|
-
expect(remoteSwiftPackageReferences?.[rspRefKeys[1]]).toBe('XCRemoteSwiftPackageReference "sentry-cocoa"');
|
|
357
|
+
(0, vitest_1.expect)(remoteSwiftPackageReferences?.[rspRefKeys[1]]).toBe('XCRemoteSwiftPackageReference "sentry-cocoa"');
|
|
357
358
|
// Check the SPM package is a dependency of the target
|
|
358
359
|
const packageProductDependencies = xcodeProject.objects.XCSwiftPackageProductDependency;
|
|
359
|
-
expect(packageProductDependencies).toBeDefined();
|
|
360
|
+
(0, vitest_1.expect)(packageProductDependencies).toBeDefined();
|
|
360
361
|
if (!packageProductDependencies) {
|
|
361
362
|
throw new Error('XCSwiftPackageProductDependency is undefined');
|
|
362
363
|
}
|
|
363
364
|
const ppDepKeys = Object.keys(packageProductDependencies);
|
|
364
|
-
expect(ppDepKeys).toHaveLength(2);
|
|
365
|
+
(0, vitest_1.expect)(ppDepKeys).toHaveLength(2);
|
|
365
366
|
// First key is expected to be the UUID of the SPM package dependency
|
|
366
|
-
expect(ppDepKeys[0]).toMatch(/^[A-F0-9]{24}$/i);
|
|
367
|
+
(0, vitest_1.expect)(ppDepKeys[0]).toMatch(/^[A-F0-9]{24}$/i);
|
|
367
368
|
// Second key is expected to be the UUID of the SPM package dependency with _comment suffix
|
|
368
|
-
expect(ppDepKeys[1]).toMatch(/^[A-F0-9]{24}_comment$/i);
|
|
369
|
-
expect(packageProductDependencies?.[ppDepKeys[0]]).toEqual({
|
|
369
|
+
(0, vitest_1.expect)(ppDepKeys[1]).toMatch(/^[A-F0-9]{24}_comment$/i);
|
|
370
|
+
(0, vitest_1.expect)(packageProductDependencies?.[ppDepKeys[0]]).toEqual({
|
|
370
371
|
isa: 'XCSwiftPackageProductDependency',
|
|
371
372
|
package: rspRefKeys[0],
|
|
372
373
|
package_comment: 'XCRemoteSwiftPackageReference "sentry-cocoa"',
|
|
@@ -376,34 +377,35 @@ describe('XcodeManager', () => {
|
|
|
376
377
|
});
|
|
377
378
|
});
|
|
378
379
|
});
|
|
379
|
-
describe('filesForTarget', () => {
|
|
380
|
-
describe('targets are undefined', () => {
|
|
381
|
-
it('should return undefined', () => {
|
|
380
|
+
(0, vitest_1.describe)('filesForTarget', () => {
|
|
381
|
+
(0, vitest_1.describe)('targets are undefined', () => {
|
|
382
|
+
(0, vitest_1.it)('should return undefined', () => {
|
|
382
383
|
// -- Arrange --
|
|
383
384
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
384
385
|
xcodeProject.objects.PBXNativeTarget = undefined;
|
|
385
386
|
// -- Act --
|
|
386
387
|
const files = xcodeProject.filesForTarget('Project');
|
|
387
388
|
// -- Assert --
|
|
388
|
-
expect(files).toBeUndefined();
|
|
389
|
+
(0, vitest_1.expect)(files).toBeUndefined();
|
|
389
390
|
});
|
|
390
391
|
});
|
|
391
|
-
describe('target not found', () => {
|
|
392
|
-
it('should return undefined', () => {
|
|
392
|
+
(0, vitest_1.describe)('target not found', () => {
|
|
393
|
+
(0, vitest_1.it)('should return undefined', () => {
|
|
393
394
|
// -- Arrange --
|
|
394
395
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
395
396
|
// -- Act --
|
|
396
397
|
const files = xcodeProject.filesForTarget('NonExistentTarget');
|
|
397
398
|
// -- Assert --
|
|
398
|
-
expect(files).toBeUndefined();
|
|
399
|
+
(0, vitest_1.expect)(files).toBeUndefined();
|
|
399
400
|
});
|
|
400
401
|
});
|
|
401
|
-
describe('target build phases are undefined', () => {
|
|
402
|
-
it('should return undefined', () => {
|
|
402
|
+
(0, vitest_1.describe)('target build phases are undefined', () => {
|
|
403
|
+
(0, vitest_1.it)('should return undefined', () => {
|
|
403
404
|
// -- Arrange --
|
|
404
405
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
405
406
|
xcodeProject.objects.PBXNativeTarget = {
|
|
406
407
|
Project: {
|
|
408
|
+
isa: 'PBXNativeTarget',
|
|
407
409
|
name: 'Project',
|
|
408
410
|
buildPhases: undefined,
|
|
409
411
|
},
|
|
@@ -411,15 +413,16 @@ describe('XcodeManager', () => {
|
|
|
411
413
|
// -- Act --
|
|
412
414
|
const files = xcodeProject.filesForTarget('Project');
|
|
413
415
|
// -- Assert --
|
|
414
|
-
expect(files).toBeUndefined();
|
|
416
|
+
(0, vitest_1.expect)(files).toBeUndefined();
|
|
415
417
|
});
|
|
416
418
|
});
|
|
417
|
-
describe('build phases are undefined', () => {
|
|
418
|
-
it('should return undefined', () => {
|
|
419
|
+
(0, vitest_1.describe)('build phases are undefined', () => {
|
|
420
|
+
(0, vitest_1.it)('should return undefined', () => {
|
|
419
421
|
// -- Arrange --
|
|
420
422
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
421
423
|
xcodeProject.objects.PBXNativeTarget = {
|
|
422
424
|
Project: {
|
|
425
|
+
isa: 'PBXNativeTarget',
|
|
423
426
|
name: 'Project',
|
|
424
427
|
buildPhases: undefined,
|
|
425
428
|
},
|
|
@@ -428,15 +431,16 @@ describe('XcodeManager', () => {
|
|
|
428
431
|
// -- Act --
|
|
429
432
|
const files = xcodeProject.filesForTarget('Project');
|
|
430
433
|
// -- Assert --
|
|
431
|
-
expect(files).toBeUndefined();
|
|
434
|
+
(0, vitest_1.expect)(files).toBeUndefined();
|
|
432
435
|
});
|
|
433
436
|
});
|
|
434
|
-
describe('referenced build phase is undefined', () => {
|
|
435
|
-
it('should return undefined', () => {
|
|
437
|
+
(0, vitest_1.describe)('referenced build phase is undefined', () => {
|
|
438
|
+
(0, vitest_1.it)('should return undefined', () => {
|
|
436
439
|
// -- Arrange --
|
|
437
440
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
438
441
|
xcodeProject.objects.PBXNativeTarget = {
|
|
439
442
|
Project: {
|
|
443
|
+
isa: 'PBXNativeTarget',
|
|
440
444
|
name: 'Project',
|
|
441
445
|
buildPhases: [
|
|
442
446
|
{
|
|
@@ -448,15 +452,16 @@ describe('XcodeManager', () => {
|
|
|
448
452
|
// -- Act --
|
|
449
453
|
const files = xcodeProject.filesForTarget('Project');
|
|
450
454
|
// -- Assert --
|
|
451
|
-
expect(files).toBeUndefined();
|
|
455
|
+
(0, vitest_1.expect)(files).toBeUndefined();
|
|
452
456
|
});
|
|
453
457
|
});
|
|
454
|
-
describe('build phase files are undefined', () => {
|
|
455
|
-
it('should return empty array', () => {
|
|
458
|
+
(0, vitest_1.describe)('build phase files are undefined', () => {
|
|
459
|
+
(0, vitest_1.it)('should return empty array', () => {
|
|
456
460
|
// -- Arrange --
|
|
457
461
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
458
462
|
xcodeProject.objects.PBXNativeTarget = {
|
|
459
463
|
Project: {
|
|
464
|
+
isa: 'PBXNativeTarget',
|
|
460
465
|
name: 'Project',
|
|
461
466
|
buildPhases: [
|
|
462
467
|
{
|
|
@@ -467,31 +472,33 @@ describe('XcodeManager', () => {
|
|
|
467
472
|
};
|
|
468
473
|
xcodeProject.objects.PBXSourcesBuildPhase = {
|
|
469
474
|
'build-phase-key': {
|
|
475
|
+
isa: 'PBXSourcesBuildPhase',
|
|
470
476
|
files: undefined,
|
|
471
477
|
},
|
|
472
478
|
};
|
|
473
479
|
// -- Act --
|
|
474
480
|
const files = xcodeProject.filesForTarget('Project');
|
|
475
481
|
// -- Assert --
|
|
476
|
-
expect(files).toEqual([]);
|
|
482
|
+
(0, vitest_1.expect)(files).toEqual([]);
|
|
477
483
|
});
|
|
478
484
|
});
|
|
479
|
-
describe('build phase has no files', () => {
|
|
480
|
-
it('should return empty array', () => {
|
|
485
|
+
(0, vitest_1.describe)('build phase has no files', () => {
|
|
486
|
+
(0, vitest_1.it)('should return empty array', () => {
|
|
481
487
|
// -- Arrange --
|
|
482
488
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
483
489
|
// -- Act --
|
|
484
490
|
const files = xcodeProject.filesForTarget('Project');
|
|
485
491
|
// -- Assert --
|
|
486
|
-
expect(files).toEqual([]);
|
|
492
|
+
(0, vitest_1.expect)(files).toEqual([]);
|
|
487
493
|
});
|
|
488
494
|
});
|
|
489
|
-
describe('build phase with files', () => {
|
|
495
|
+
(0, vitest_1.describe)('build phase with files', () => {
|
|
490
496
|
let xcodeProject;
|
|
491
|
-
beforeEach(() => {
|
|
497
|
+
(0, vitest_1.beforeEach)(() => {
|
|
492
498
|
xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
493
499
|
xcodeProject.objects.PBXNativeTarget = {
|
|
494
500
|
'some-target': {
|
|
501
|
+
isa: 'PBXNativeTarget',
|
|
495
502
|
name: 'some-target',
|
|
496
503
|
buildPhases: [
|
|
497
504
|
{
|
|
@@ -502,6 +509,7 @@ describe('XcodeManager', () => {
|
|
|
502
509
|
};
|
|
503
510
|
xcodeProject.objects.PBXSourcesBuildPhase = {
|
|
504
511
|
'build-phase-key': {
|
|
512
|
+
isa: 'PBXSourcesBuildPhase',
|
|
505
513
|
files: [
|
|
506
514
|
{
|
|
507
515
|
value: 'file-key',
|
|
@@ -522,62 +530,62 @@ describe('XcodeManager', () => {
|
|
|
522
530
|
},
|
|
523
531
|
];
|
|
524
532
|
});
|
|
525
|
-
describe('build file objects are not defined', () => {
|
|
526
|
-
it('should return empty array', () => {
|
|
533
|
+
(0, vitest_1.describe)('build file objects are not defined', () => {
|
|
534
|
+
(0, vitest_1.it)('should return empty array', () => {
|
|
527
535
|
// -- Arrange --
|
|
528
536
|
xcodeProject.objects.PBXBuildFile = undefined;
|
|
529
537
|
// -- Act --
|
|
530
538
|
const files = xcodeProject.filesForTarget('some-target');
|
|
531
539
|
// -- Assert --
|
|
532
|
-
expect(files).toEqual([]);
|
|
540
|
+
(0, vitest_1.expect)(files).toEqual([]);
|
|
533
541
|
});
|
|
534
542
|
});
|
|
535
|
-
describe('build file object is not found', () => {
|
|
536
|
-
it('should return empty array', () => {
|
|
543
|
+
(0, vitest_1.describe)('build file object is not found', () => {
|
|
544
|
+
(0, vitest_1.it)('should return empty array', () => {
|
|
537
545
|
// -- Arrange --
|
|
538
546
|
xcodeProject.objects.PBXBuildFile = {};
|
|
539
547
|
// -- Act --
|
|
540
548
|
const files = xcodeProject.filesForTarget('some-target');
|
|
541
549
|
// -- Assert --
|
|
542
|
-
expect(files).toEqual([]);
|
|
550
|
+
(0, vitest_1.expect)(files).toEqual([]);
|
|
543
551
|
});
|
|
544
552
|
});
|
|
545
|
-
describe('build file object exists', () => {
|
|
546
|
-
describe('file reference is undefined', () => {
|
|
547
|
-
it('should ignore the file', () => {
|
|
553
|
+
(0, vitest_1.describe)('build file object exists', () => {
|
|
554
|
+
(0, vitest_1.describe)('file reference is undefined', () => {
|
|
555
|
+
(0, vitest_1.it)('should ignore the file', () => {
|
|
548
556
|
// -- Arrange --
|
|
549
557
|
xcodeProject.files = [];
|
|
550
558
|
// -- Act --
|
|
551
559
|
const files = xcodeProject.filesForTarget('some-target');
|
|
552
560
|
// -- Assert --
|
|
553
|
-
expect(files).toEqual([]);
|
|
561
|
+
(0, vitest_1.expect)(files).toEqual([]);
|
|
554
562
|
});
|
|
555
563
|
});
|
|
556
|
-
it('should return array of file paths', () => {
|
|
564
|
+
(0, vitest_1.it)('should return array of file paths', () => {
|
|
557
565
|
// -- Act --
|
|
558
566
|
const files = xcodeProject.filesForTarget('some-target');
|
|
559
567
|
// -- Assert --
|
|
560
|
-
expect(files).toEqual([
|
|
568
|
+
(0, vitest_1.expect)(files).toEqual([
|
|
561
569
|
path.join(appleProjectsPath, 'spm-swiftui-single-target', 'file-path'),
|
|
562
570
|
]);
|
|
563
571
|
});
|
|
564
572
|
});
|
|
565
573
|
});
|
|
566
574
|
});
|
|
567
|
-
describe('projectFiles', () => {
|
|
568
|
-
describe('no groups in project', () => {
|
|
569
|
-
it('should return empty array', () => {
|
|
575
|
+
(0, vitest_1.describe)('projectFiles', () => {
|
|
576
|
+
(0, vitest_1.describe)('no groups in project', () => {
|
|
577
|
+
(0, vitest_1.it)('should return empty array', () => {
|
|
570
578
|
// -- Arrange --
|
|
571
579
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
572
580
|
xcodeProject.objects.PBXGroup = undefined;
|
|
573
581
|
// -- Act --
|
|
574
582
|
const files = xcodeProject.projectFiles();
|
|
575
583
|
// -- Assert --
|
|
576
|
-
expect(files).toEqual([]);
|
|
584
|
+
(0, vitest_1.expect)(files).toEqual([]);
|
|
577
585
|
});
|
|
578
586
|
});
|
|
579
|
-
describe('main group not found', () => {
|
|
580
|
-
it('should return empty array', () => {
|
|
587
|
+
(0, vitest_1.describe)('main group not found', () => {
|
|
588
|
+
(0, vitest_1.it)('should return empty array', () => {
|
|
581
589
|
// -- Arrange --
|
|
582
590
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
583
591
|
const project = xcodeProject.objects.PBXProject?.['D4E604C52D50CEEC00CAB00F'];
|
|
@@ -587,64 +595,68 @@ describe('XcodeManager', () => {
|
|
|
587
595
|
// -- Act --
|
|
588
596
|
const files = xcodeProject.projectFiles();
|
|
589
597
|
// -- Assert --
|
|
590
|
-
expect(files).toEqual([]);
|
|
598
|
+
(0, vitest_1.expect)(files).toEqual([]);
|
|
591
599
|
});
|
|
592
600
|
});
|
|
593
|
-
describe('main group found', () => {
|
|
594
|
-
it('should return array of file paths', () => {
|
|
601
|
+
(0, vitest_1.describe)('main group found', () => {
|
|
602
|
+
(0, vitest_1.it)('should return array of file paths', () => {
|
|
595
603
|
// -- Arrange --
|
|
596
604
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
597
605
|
// -- Act --
|
|
598
606
|
const files = xcodeProject.projectFiles();
|
|
599
607
|
// -- Assert --
|
|
600
|
-
expect(files).toEqual([
|
|
608
|
+
(0, vitest_1.expect)(files).toEqual([
|
|
601
609
|
{
|
|
602
610
|
key: 'D4E604CD2D50CEEC00CAB00F',
|
|
603
611
|
path: 'Project.app',
|
|
604
612
|
},
|
|
605
613
|
]);
|
|
606
614
|
});
|
|
607
|
-
it('should cache the result', () => {
|
|
615
|
+
(0, vitest_1.it)('should cache the result', () => {
|
|
608
616
|
// -- Arrange --
|
|
609
617
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
610
618
|
// Smoke test
|
|
611
|
-
expect(xcodeProject.files).toBeUndefined();
|
|
619
|
+
(0, vitest_1.expect)(xcodeProject.files).toBeUndefined();
|
|
612
620
|
// -- Act --
|
|
613
621
|
const files = xcodeProject.projectFiles();
|
|
614
622
|
// -- Assert --
|
|
615
|
-
expect(xcodeProject.files).toBeDefined();
|
|
616
|
-
expect(xcodeProject.files).toEqual(files);
|
|
623
|
+
(0, vitest_1.expect)(xcodeProject.files).toBeDefined();
|
|
624
|
+
(0, vitest_1.expect)(xcodeProject.files).toEqual(files);
|
|
617
625
|
});
|
|
618
626
|
});
|
|
619
627
|
});
|
|
620
|
-
describe('buildGroup', () => {
|
|
621
|
-
describe('group has undefined children', () => {
|
|
622
|
-
it('should return empty array', () => {
|
|
628
|
+
(0, vitest_1.describe)('buildGroup', () => {
|
|
629
|
+
(0, vitest_1.describe)('group has undefined children', () => {
|
|
630
|
+
(0, vitest_1.it)('should return empty array', () => {
|
|
623
631
|
// -- Arrange --
|
|
624
632
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
625
633
|
const group = {
|
|
634
|
+
isa: 'PBXGroup',
|
|
626
635
|
children: undefined,
|
|
627
636
|
path: '',
|
|
628
637
|
};
|
|
629
638
|
// -- Act --
|
|
630
639
|
const files = xcodeProject.buildGroup(group);
|
|
631
640
|
// -- Assert --
|
|
632
|
-
expect(files).toEqual([]);
|
|
641
|
+
(0, vitest_1.expect)(files).toEqual([]);
|
|
633
642
|
});
|
|
634
643
|
});
|
|
635
|
-
describe('group has no children', () => {
|
|
636
|
-
it('should return empty array', () => {
|
|
644
|
+
(0, vitest_1.describe)('group has no children', () => {
|
|
645
|
+
(0, vitest_1.it)('should return empty array', () => {
|
|
637
646
|
// -- Arrange --
|
|
638
647
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
639
|
-
const group = {
|
|
648
|
+
const group = {
|
|
649
|
+
isa: 'PBXGroup',
|
|
650
|
+
};
|
|
640
651
|
// -- Act --
|
|
641
652
|
const files = xcodeProject.buildGroup(group);
|
|
642
653
|
// -- Assert --
|
|
643
|
-
expect(files).toEqual([]);
|
|
654
|
+
(0, vitest_1.expect)(files).toEqual([]);
|
|
644
655
|
});
|
|
645
656
|
});
|
|
646
|
-
describe('group child is file reference', () => {
|
|
657
|
+
(0, vitest_1.describe)('group child is file reference', () => {
|
|
647
658
|
const group = {
|
|
659
|
+
isa: 'PBXGroup',
|
|
648
660
|
children: [
|
|
649
661
|
{
|
|
650
662
|
value: 'D4E604CD2D50CEEC00CAB00F',
|
|
@@ -652,22 +664,23 @@ describe('XcodeManager', () => {
|
|
|
652
664
|
],
|
|
653
665
|
path: '',
|
|
654
666
|
};
|
|
655
|
-
describe('file references are undefined', () => {
|
|
656
|
-
it('should return empty array', () => {
|
|
667
|
+
(0, vitest_1.describe)('file references are undefined', () => {
|
|
668
|
+
(0, vitest_1.it)('should return empty array', () => {
|
|
657
669
|
// -- Arrange --
|
|
658
670
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
659
671
|
xcodeProject.objects.PBXFileReference = undefined;
|
|
660
672
|
// -- Act --
|
|
661
673
|
const files = xcodeProject.buildGroup(group);
|
|
662
674
|
// -- Assert --
|
|
663
|
-
expect(files).toEqual([]);
|
|
675
|
+
(0, vitest_1.expect)(files).toEqual([]);
|
|
664
676
|
});
|
|
665
677
|
});
|
|
666
|
-
describe('file reference is string', () => {
|
|
667
|
-
it('should be ignored', () => {
|
|
678
|
+
(0, vitest_1.describe)('file reference is string', () => {
|
|
679
|
+
(0, vitest_1.it)('should be ignored', () => {
|
|
668
680
|
// -- Arrange --
|
|
669
681
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
670
682
|
const group = {
|
|
683
|
+
isa: 'PBXGroup',
|
|
671
684
|
children: [
|
|
672
685
|
{
|
|
673
686
|
value: 'D4E604CD2D50CEEC00CAB00F_comment',
|
|
@@ -678,19 +691,22 @@ describe('XcodeManager', () => {
|
|
|
678
691
|
// -- Act --
|
|
679
692
|
const files = xcodeProject.buildGroup(group);
|
|
680
693
|
// -- Assert --
|
|
681
|
-
expect(files).toEqual([]);
|
|
694
|
+
(0, vitest_1.expect)(files).toEqual([]);
|
|
682
695
|
});
|
|
683
696
|
});
|
|
684
|
-
describe('file reference is valid', () => {
|
|
685
|
-
it('should return array of escaped paths', () => {
|
|
697
|
+
(0, vitest_1.describe)('file reference is valid', () => {
|
|
698
|
+
(0, vitest_1.it)('should return array of escaped paths', () => {
|
|
686
699
|
// -- Arrange --
|
|
687
700
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
688
701
|
xcodeProject.objects.PBXFileReference = {
|
|
689
702
|
D4E604CD2D50CEEC00CAB00F: {
|
|
703
|
+
isa: 'PBXFileReference',
|
|
690
704
|
path: '"some/path/to/file.swift"',
|
|
705
|
+
sourceTree: 'SOURCE_ROOT',
|
|
691
706
|
},
|
|
692
707
|
};
|
|
693
708
|
const group = {
|
|
709
|
+
isa: 'PBXGroup',
|
|
694
710
|
children: [
|
|
695
711
|
{
|
|
696
712
|
value: 'D4E604CD2D50CEEC00CAB00F',
|
|
@@ -701,7 +717,7 @@ describe('XcodeManager', () => {
|
|
|
701
717
|
// -- Act --
|
|
702
718
|
const files = xcodeProject.buildGroup(group);
|
|
703
719
|
// -- Assert --
|
|
704
|
-
expect(files).toEqual([
|
|
720
|
+
(0, vitest_1.expect)(files).toEqual([
|
|
705
721
|
{
|
|
706
722
|
key: 'D4E604CD2D50CEEC00CAB00F',
|
|
707
723
|
path: 'some/path/to/file.swift',
|
|
@@ -710,8 +726,9 @@ describe('XcodeManager', () => {
|
|
|
710
726
|
});
|
|
711
727
|
});
|
|
712
728
|
});
|
|
713
|
-
describe('group child is group reference', () => {
|
|
729
|
+
(0, vitest_1.describe)('group child is group reference', () => {
|
|
714
730
|
const group = {
|
|
731
|
+
isa: 'PBXGroup',
|
|
715
732
|
children: [
|
|
716
733
|
{
|
|
717
734
|
value: 'D4E604C42D50CEEC00CAB00F',
|
|
@@ -719,22 +736,23 @@ describe('XcodeManager', () => {
|
|
|
719
736
|
],
|
|
720
737
|
path: '',
|
|
721
738
|
};
|
|
722
|
-
describe('groups are undefined', () => {
|
|
723
|
-
it('should return empty array', () => {
|
|
739
|
+
(0, vitest_1.describe)('groups are undefined', () => {
|
|
740
|
+
(0, vitest_1.it)('should return empty array', () => {
|
|
724
741
|
// -- Arrange --
|
|
725
742
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
726
743
|
xcodeProject.objects.PBXGroup = undefined;
|
|
727
744
|
// -- Act --
|
|
728
745
|
const files = xcodeProject.buildGroup(group);
|
|
729
746
|
// -- Assert --
|
|
730
|
-
expect(files).toEqual([]);
|
|
747
|
+
(0, vitest_1.expect)(files).toEqual([]);
|
|
731
748
|
});
|
|
732
749
|
});
|
|
733
|
-
describe('group reference is string', () => {
|
|
734
|
-
it('should return array of file paths', () => {
|
|
750
|
+
(0, vitest_1.describe)('group reference is string', () => {
|
|
751
|
+
(0, vitest_1.it)('should return array of file paths', () => {
|
|
735
752
|
// -- Arrange --
|
|
736
753
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
737
754
|
const group = {
|
|
755
|
+
isa: 'PBXGroup',
|
|
738
756
|
children: [
|
|
739
757
|
{
|
|
740
758
|
value: 'D4E604CE2D50CEEC00CAB00F_comment',
|
|
@@ -745,17 +763,17 @@ describe('XcodeManager', () => {
|
|
|
745
763
|
// -- Act --
|
|
746
764
|
const files = xcodeProject.buildGroup(group);
|
|
747
765
|
// -- Assert --
|
|
748
|
-
expect(files).toEqual([]);
|
|
766
|
+
(0, vitest_1.expect)(files).toEqual([]);
|
|
749
767
|
});
|
|
750
768
|
});
|
|
751
|
-
describe('group reference is valid', () => {
|
|
752
|
-
it('should return array of file paths', () => {
|
|
769
|
+
(0, vitest_1.describe)('group reference is valid', () => {
|
|
770
|
+
(0, vitest_1.it)('should return array of file paths', () => {
|
|
753
771
|
// -- Arrange --
|
|
754
772
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
755
773
|
// -- Act --
|
|
756
774
|
const files = xcodeProject.buildGroup(group);
|
|
757
775
|
// -- Assert --
|
|
758
|
-
expect(files).toEqual([
|
|
776
|
+
(0, vitest_1.expect)(files).toEqual([
|
|
759
777
|
{
|
|
760
778
|
key: 'D4E604CD2D50CEEC00CAB00F',
|
|
761
779
|
path: 'Project.app',
|
|
@@ -763,11 +781,12 @@ describe('XcodeManager', () => {
|
|
|
763
781
|
]);
|
|
764
782
|
});
|
|
765
783
|
});
|
|
766
|
-
describe('group reference has path', () => {
|
|
767
|
-
it('should append the path to the file paths', () => {
|
|
784
|
+
(0, vitest_1.describe)('group reference has path', () => {
|
|
785
|
+
(0, vitest_1.it)('should append the path to the file paths', () => {
|
|
768
786
|
// -- Arrange --
|
|
769
787
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
770
788
|
const group = {
|
|
789
|
+
isa: 'PBXGroup',
|
|
771
790
|
children: [
|
|
772
791
|
{
|
|
773
792
|
value: 'sub-group',
|
|
@@ -776,6 +795,7 @@ describe('XcodeManager', () => {
|
|
|
776
795
|
path: '"some/path/to/group"',
|
|
777
796
|
};
|
|
778
797
|
const subgroup = {
|
|
798
|
+
isa: 'PBXGroup',
|
|
779
799
|
children: [
|
|
780
800
|
{
|
|
781
801
|
value: 'file-at-path',
|
|
@@ -783,7 +803,9 @@ describe('XcodeManager', () => {
|
|
|
783
803
|
],
|
|
784
804
|
};
|
|
785
805
|
const file = {
|
|
806
|
+
isa: 'PBXFileReference',
|
|
786
807
|
path: '"some/file/at/path.swift"',
|
|
808
|
+
sourceTree: '<group>',
|
|
787
809
|
};
|
|
788
810
|
xcodeProject.objects.PBXGroup = {
|
|
789
811
|
'main-group': group,
|
|
@@ -795,7 +817,7 @@ describe('XcodeManager', () => {
|
|
|
795
817
|
// -- Act --
|
|
796
818
|
const files = xcodeProject.buildGroup(group);
|
|
797
819
|
// -- Assert --
|
|
798
|
-
expect(files).toEqual([
|
|
820
|
+
(0, vitest_1.expect)(files).toEqual([
|
|
799
821
|
{
|
|
800
822
|
key: 'file-at-path',
|
|
801
823
|
path: 'some/file/at/path.swift',
|
|
@@ -804,13 +826,14 @@ describe('XcodeManager', () => {
|
|
|
804
826
|
});
|
|
805
827
|
});
|
|
806
828
|
});
|
|
807
|
-
describe('group child is not a file reference or group', () => {
|
|
808
|
-
it('should be ignored', () => {
|
|
829
|
+
(0, vitest_1.describe)('group child is not a file reference or group', () => {
|
|
830
|
+
(0, vitest_1.it)('should be ignored', () => {
|
|
809
831
|
// -- Arrange --
|
|
810
832
|
const xcodeProject = new xcode_manager_1.XcodeProject(singleTargetProjectPath);
|
|
811
833
|
xcodeProject.objects.PBXGroup = {};
|
|
812
834
|
xcodeProject.objects.PBXFileReference = {};
|
|
813
835
|
const group = {
|
|
836
|
+
isa: 'PBXGroup',
|
|
814
837
|
children: [
|
|
815
838
|
{
|
|
816
839
|
value: 'random-key',
|
|
@@ -821,7 +844,7 @@ describe('XcodeManager', () => {
|
|
|
821
844
|
// -- Act --
|
|
822
845
|
const files = xcodeProject.buildGroup(group);
|
|
823
846
|
// -- Assert --
|
|
824
|
-
expect(files).toEqual([]);
|
|
847
|
+
(0, vitest_1.expect)(files).toEqual([]);
|
|
825
848
|
});
|
|
826
849
|
});
|
|
827
850
|
});
|