These projects from the OPA ecosystem help with or support running of tests on Rego code.
DAS supports the running of tests alongside Rego policy in its UI. Read documentation about testing Rego policies in DAS.
Regal is a useful step to use when testing Rego policies to ensure code is correct and free of common errors. See the README to get started.
Conftest supports unit testing of policy and has a number of extra language features for working with configuration files. The functionality is documented here.
Enterprise OPA's Live Impact Analysis (LIA) feature allows you to test changes to Rego policy on running instances.
GitHub Action for OPA Rego Policy Tests automates testing for your OPA (Open Policy Agent) Rego policies, generates a report with coverage information, and posts the test results as a comment on your pull requests, making it easy for your team to review and approve policies.
The rego-test-assertions library contains various assertion functions, which will print the expected result vs. the outcome to the console on failure.