Optimizely Connect Platform (OCP) app templates include a configuration for Jest, but you can use any unit testing framework as long as you configure it to run using the
yarn test command. Unit tests run automatically before uploads and when building your app to run on OCP infrastructure. If any tests fail, you cannot publish your app.
Optimizely strongly recommends coverage minimums.
See the basic template (generated from the
ocp app init command) for examples on how to use unit tests to cover difficult tasks such as a state machine-based job.
To ease development and testing, you can install apps into an account from the OCP command-line interface (CLI), even when they are not visible in the Optimizely Data Platform (ODP) App directry (for example, development and beta versions).
Use pre-release tags, like
-beta, to publish a new version of an app without making it public or automatically upgrading existing installations.
You can also manually install pre-release apps from the OCP CLI, using the following command:
ocp directory install [email protected] <tracker_id>
<tracker_id> is the Tracker ID of the ODP account to which you wish to install. When this command completes, your app is installed and ready to go. You can verify the app is installed with the following command:
ocp directory list-installs [email protected]
To manually uninstall an app from an account, run the following command in the OCP CLI:
ocp directory uninstall [email protected] <tracker_id>
Updated 4 months ago