Newer Version Available
Specify Unpackaged Metadata or Apex Access for Package Version Creation Tests for Second-Generation Managed Packages
For scenarios where you require metadata that isn’t part of your
second-generation managed package, but is necessary for Apex test runs, you can specify
the path containing unpackaged metadata in the sfdx-project.json
file. The unpackaged metadata isn’t included in the package and isn’t installed in
subscriber orgs.
Specify Unpackaged Metadata for Package Version Creation Tests
Specify the path to the unpackaged metadata in your sfdx-project.json file.
In this example, metadata in the my-unpackaged-directory is available for test runs during the package version creation of the TV_unl package.
The unpackagedMetadata attribute is intended for metadata that isn’t part of your package. You can’t include the same metadata in both an unpackaged directory and a packaged directory.
Manage Apex Access for Package Version Creation Tests
Sometimes the Apex tests that you write require a user to have certain permission sets or permission set licenses. Use the apexTestAccess setting to assign permission sets and permission set licenses to the user in whose context your Apex tests get run at package version creation.