Files
react-native/scripts/e2e/run-e2e-tests.js
T
szymonrybczak 378aa72ed6 Unify test-e2e command in rn-tester-e2e pacakge (#38701)
Summary:
This PR is small cleanup in scripts in `rn-tester-e2e` package, it creates unified script so that we can easily pass platform as an argument. Context: https://github.com/facebook/react-native/pull/36267#discussion_r1269378065

## Changelog:
[INTERNAL] [CHANGED] - Unify `test-e2e` command in `rn-tester-e2e` package

Pull Request resolved: https://github.com/facebook/react-native/pull/38701

Test Plan: CI Green 

Reviewed By: NickGerleman, cipolleschi

Differential Revision: D47949821

Pulled By: cortinico

fbshipit-source-id: 90bbc96281e89dec505999ff5e51db7ca78da6dc
2023-08-02 03:38:08 -07:00

17 lines
582 B
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const SUPPORTED_PLATFORMS = ['ios', 'android'];
if (process.argv.length !== 3 || !SUPPORTED_PLATFORMS.includes(process.argv[2])) {
throw new Error(`Invalid platform. Supported platforms are: ${SUPPORTED_PLATFORMS.join(', ')}`);
}
const platform = process.argv[2];
const { execSync } = require('child_process');
execSync(`E2E_DEVICE=${platform} jest --runInBand`, { stdio: 'inherit' });