Coder Social home page Coder Social logo

react-native-test-runner's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-native-test-runner's Issues

Make --simulator switch optional

When this option is not provided, find the currently booted emulator. If none, exit the process with a non-zero status code and an appropriate error message.

Add a --ci option

If there is already a booted emulator (AVD) or iOS simulador and either --simulator or --emulator option is passed, the runner does not honor the user's choice because it does not attempt to boot the specified AVD or iOS simulator. In this case, the runner launches the test app in the already booted device and we don't want this behavior.

The runner should always honor the user's choice. Booting a second device is also desirable because:

  • We don't know if the device is set up with the runtime we need, e.g., Android API level and iOS version
  • The already booted device might be in use for some other purpose. We shouldn't take it over or control it.

I propose introducing a new option, --ci, to override the behavior described above. With this option, the runner explicitly searches for the device that is already booted to launch the test app.
If more than one device is found, exit with an error.
If no devices are found, also exit with an error.
If both --ci and either --simulator or --emulator are passed, also exit with an error. These options are mutually exclusive.

The --ci option is useful in CI environments where an AVD or iOS simulator is already booted prior to the runner's execution.

Exit with an error when not running on macOS and `--platform` is set to 'ios'

iOS development toolchain is only available on Apple's OS.

  • Check whether the return value of os.platform() is darwin to ensure we're running in macOS.
  • Check the output of xcode-select -p which returns the path to developer directory. Alternatively, we might be able to check the exit code.
  • Check whether xcodebuild is in the PATH.

Make --emulator switch optional

When this option is not provided, find the currently booted emulator. If none, exit the process with a non-zero status code and an appropriate error message.

Load user provided babel config

A babel config file is currently being shipped with the test runner. However, if the test runner is used in a project which has its own babel config, it's not possible to override it or add additional plugins. I'm not exactly sure how Metro behaves in this regard, so it's necessary to investigate whether Metro can load a config from the current working directory by default.

Fix Mocha require cycle

When requiring Mocha from the test app, the following warning message is being displayed:

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.

The message is being filtered out for the time being as a workaround. Although the runner appears to be working as expected, we must find a way to resolve this. Note that we can't use require('mocha'), otherwise Metro picks up the implementation for Node.

Clarify the limitations of the test runner regarding native platform support

In the README, it is stated in the limitations section that there is "no support for Windows and macOS". This statement may sound confusing to some people. While the test runner is expected to work on macOS and Windows operating systems without issues, React Native macOS and React Native Windows are not supported as target platforms to run tests agaisnt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.