Newer Version Available

This content describes an older version of this product. View Latest

Specify Unpackaged Metadata for Package Version Creation Tests

If there are scenarios where you require metadata that shouldn’t be part of your package, but is necessary for Apex test runs during package version creation, you can specify the path containing unpackaged metadata in the sfdx-project.json file. Unpackaged metadata isn’t included in the package and isn’t installed in subscriber orgs.

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.

1"packageDirectories": [
2    {
3        "path": "force-app",
4        "package": "TV_unl", 
5        "versionName": "ver 0.1",
6        "versionNumber": "0.1.0.NEXT",
7        "default": true, 
8        "unpackagedMetadata": {
9            "path": "my-unpackaged-directory"
10        }
11    }, 
12    {
13        "path": "my-unpackaged-directory",
14        "default": false
15    }
16]

The unpackagedMetadata attribute is intended for metadata that shouldn’t be part of your package. You can’t include the same metadata in both an unpackaged directory and a packaged directory.