You're reading the documentation for a version of ROS 2 that has reached its EOL (end-of-life), and is no longer officially supported. If you want up-to-date information, please have a look at Humble.
Running Tests in ROS 2 from the Command Line
Build and run your tests
To compile and run the tests, simply run the test verb from
colcon test --cmake-args tests [package_selection_args]
package_selection_args are optional package selection arguments for
colcon to limit which packages are built and run)