Add something like the following to the runner's phpunit.xml. more info
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../web/modules/custom/loft_core</directory>
<exclude>
<file>../web/modules/custom/loft_core/src/StaticContentStreamWrapper.php</file>
</exclude>
<!-- By definition test classes have no tests. -->
<exclude>
<directory suffix="Test.php">./</directory>
<directory suffix="TestBase.php">./</directory>
</exclude>
</whitelist>
</filter>
Use the CLI flag --coverage-html <directory>
--testsuite Unit --filter LoftCoreUnitTest --coverage-html coverage
</whitelist>