Cavy

Cavy

  • Documentation
  • API
  • GitHub
  • FAQ

›Guides

Getting Started

  • Installing
  • Setting up the Cavy Tester
  • Writing tests

    • Hooking up components
    • Writing test cases
  • Running tests

Guides

  • Specifing a custom app entry point
  • Writing your own spec helpers
  • Writing your own custom reporter
  • Cavy Native Reporter

    • Using Cavy Native Reporter
    • iOS XCTest example (Obj-C)
    • iOS XCTest example (Swift)
    • Android example (JUnit)

API reference

  • CLI Commands
  • Helpers
  • Tester Component
  • Test Hooks
  • Cavy Native Reporter

Specifing a custom app entry point

This guide is only relevant if you're running Cavy with cavy-cli.

By default, Cavy looks for an index.js entry point in your React Native project. Running cavy init will generate a corresponding index.test.js file, which is used to make sure that your tests only run when booting your app via Cavy.

Setting up a custom entry point

If your app uses a different entry point, you will need to rename the automatically generated index.test.js file so that it is the same as your entry point, but suffixed with .test.js. For example, if your app entry point is index.ios.js, your test entry point should be called index.ios.test.js.

Running tests

To run your tests with a custom app entry point, run the test commands with the --file flag, followed by the filename as a string. For example:

cavy run-ios --file index.ios.js

If you're using any extra React Native CLI options, make sure to include them after the cavy-cli --file flag.

← Running testsWriting your own spec helpers →
  • Setting up a custom entry point
  • Running tests
Cavy
Docs
Getting StartedGuidesAPI Reference
Community
HelpContributorsFurther reading
More
GitHub
Star
Follow @pixielabs
Tweet
Copyright © 2019 Pixie Labs