From 818f788064488e1ab2b34b05658b5266aee552f1 Mon Sep 17 00:00:00 2001 From: Dimitar Nestorov Date: Fri, 27 Jan 2023 18:39:50 +0200 Subject: [PATCH 1/3] fix: test expected value on macOS --- __e2e__/config.test.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/__e2e__/config.test.ts b/__e2e__/config.test.ts index f4c86659e..bdff331fe 100644 --- a/__e2e__/config.test.ts +++ b/__e2e__/config.test.ts @@ -87,7 +87,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(''); }); From 0d4de6c25d54c51d4ff5b452e812107284cdde53 Mon Sep 17 00:00:00 2001 From: Dimitar Nestorov Date: Fri, 27 Jan 2023 18:39:50 +0200 Subject: [PATCH 2/3] fix: macOS E2E snapshot test --- __e2e__/__snapshots__/config.test.ts.snap | 6 +----- __e2e__/config.test.ts | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) 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 bdff331fe..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, From 1097c4483993fb6252c5b5747945378a5865a5eb Mon Sep 17 00:00:00 2001 From: Dimitar Nestorov Date: Fri, 27 Jan 2023 18:39:50 +0200 Subject: [PATCH 3/3] ci: run E2E tests on macOS --- .github/workflows/test.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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: