diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e9f9d3fee..0e71e4208 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,8 +45,8 @@ jobs: strategy: matrix: node-version: [18] - os: [ubuntu-latest] - # TODO: add macos, windows + os: [ubuntu-latest, macos-latest] + # TODO: add windows runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -56,6 +56,16 @@ jobs: java-version: 11 cache: 'gradle' + - uses: ruby/setup-ruby@v1 + if: runner.os == 'macOS' + with: + ruby-version: '2.7.6' + + - uses: actions/setup-python@v4 + if: runner.os == 'macOS' + with: + python-version: '3.10' + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: diff --git a/__e2e__/__snapshots__/config.test.ts.snap b/__e2e__/__snapshots__/config.test.ts.snap index 85fd6d341..b5ac0aaf8 100644 --- a/__e2e__/__snapshots__/config.test.ts.snap +++ b/__e2e__/__snapshots__/config.test.ts.snap @@ -46,11 +46,7 @@ exports[`shows up current config without unnecessary output 1`] = ` }, "project": { "ios": { - "sourceDir": "<>/TestProject/ios", - "xcodeProject": { - "name": "TestProject.xcodeproj", - "isWorkspace": false - } + "sourceDir": "<>/TestProject/ios" }, "android": { "sourceDir": "<>/TestProject/android", diff --git a/__e2e__/config.test.ts b/__e2e__/config.test.ts index f4c86659e..527225bb2 100644 --- a/__e2e__/config.test.ts +++ b/__e2e__/config.test.ts @@ -76,6 +76,23 @@ test('shows up current config without unnecessary output', () => { options: command.options && ['<>'], })); + const expectedXcodeProject = + process.platform === 'darwin' + ? { + name: 'TestProject.xcworkspace', + isWorkspace: true, + } + : { + name: 'TestProject.xcodeproj', + isWorkspace: false, + }; + + expect(parsedStdout.project.ios.xcodeProject).toStrictEqual( + expectedXcodeProject, + ); + + delete parsedStdout.project.ios.xcodeProject; + const configWithReplacedProjectRoots = replaceProjectRootInOutput( JSON.stringify(parsedStdout, null, 2).replace(/\\\\/g, '\\'), DIR, @@ -87,7 +104,17 @@ test('should log only valid JSON config if setting up env throws an error', () = const restoreOriginalSetupEnvScript = createCorruptedSetupEnvScript(); const {stdout, stderr} = runCLI(path.join(DIR, 'TestProject'), ['config']); + const filteredStderr = + process.platform === 'darwin' + ? stderr + .split('\n') + .filter( + (line) => !line.startsWith('warn Multiple Podfiles were found'), + ) + .join('\n') + : stderr; + restoreOriginalSetupEnvScript(); expect(isValidJSON(stdout)).toBe(true); - expect(stderr).toBe(''); + expect(filteredStderr).toBe(''); });