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:

depdependencies {
	// ...
	testImplementation testFixtures("dev.frozenmilk.dairy:Core:<MAJ.MIN.ENG>")
	// ...
}

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.

Writing an OpMode for testing

This is super useful for library authors working with Dairy.

TestOpMode

TestLinearOpMode

Running a teamcode OpMode as a test

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.

Configuring Test OpModes

Lastly, we can configure OpModes to do things like setup hardware.