Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Code Coverage for Unlocked Packages
To compute code coverage using Salesforce CLI, use the --code-coverage parameter when you run the sf package version create command.
Package version creation can take longer to complete when code coverage is being computed, so consider when in the development cycle to include the code coverage parameter. You can choose to skip code coverage, and you can skip all validation by specifying the --skip-validation parameter. You can promote package versions only if they’re validated and meet code coverage requirements.
View code coverage information for a package version using sf package version list with the --verbose parameter, or the sf package version report command in Salesforce CLI.
We don’t calculate code coverage for org-dependent unlocked packages.