You need to sign in to do that
Don't have an account?
Diane Clayton 6
dx packaging version create apex test
Hi
When I try to create a new version of one of my dx packages with the code coverage flag it's failing on a unit test. I think this is because it needs to use a global value set in the dependent package.
If I install my package in a new scratch org with it's 4 dependent packages that are listed in the sfdx-project.json then the unit tests all pass. Is there anyway to get around this?
When I try to create a new version of one of my dx packages with the code coverage flag it's failing on a unit test. I think this is because it needs to use a global value set in the dependent package.
If I install my package in a new scratch org with it's 4 dependent packages that are listed in the sfdx-project.json then the unit tests all pass. Is there anyway to get around this?
What is the error message you see? For error 'Duplicate values' check below link.
https://help.salesforce.com/articleView?id=000316059&type=1&mode=1
Also, try to include a global value set and deploy or unplug the references from test class to avoid errors.
Hope this helps...
Thanks,
The error was in a unit test error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLISTO Code: invalid curre, Default Currency ISO Code: invalid currency code: GBP
This was because when I created scratch org via powershell script be were adding in currencyType object so the unit tests all work. However when it runs test with -code coverage flag to create package version it doesn't have access to the currencyTypes. I hoped to fix this by adding them in test setup but currency type doesn't allow DML operation. So we can not add unit tests around these.
https://www.ultrageek.com/?p=421
https://help.salesforce.com/articleView?id=000320321&type=1&mode=1
Thanks,