Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
6 changes: 1 addition & 5 deletions __e2e__/__snapshots__/config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ exports[`shows up current config without unnecessary output 1`] = `
},
"project": {
"ios": {
"sourceDir": "<<REPLACED_ROOT>>/TestProject/ios",
"xcodeProject": {
"name": "TestProject.xcodeproj",
"isWorkspace": false
}
"sourceDir": "<<REPLACED_ROOT>>/TestProject/ios"
},
"android": {
"sourceDir": "<<REPLACED_ROOT>>/TestProject/android",
Expand Down
29 changes: 28 additions & 1 deletion __e2e__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,23 @@ test('shows up current config without unnecessary output', () => {
options: command.options && ['<<REPLACED>>'],
}));

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,
Expand All @@ -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('');
});