Dairy supports a unit test runtime, to use it you need to add Dairy’s test
fixtures as a test dependency:Add the newest version of Core found
here to
the dependencies block:
Then, you’ll need to set up a unit test source set, and add the
org.firstinspires.ftc.teamcode packages.Test OpModes can be combined with Features to test both that OpModes behave as
expected and that Features behave as expected.
At the moment this is a bit limited, as there is no direct support for mocking
hardware or telemetry, but its possible for you to do this yourself, and support
for doing so easily is on the roadmap.
Copy
@RunWith(OpModeTestRunner.class)public class TeamCodeTest extends ExternalTest { public TeamCodeTest() { // we'll use an OpMode we defined, but we can use one from teamcode super(IterativeTest.class); }}