function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

How to write unit tests for a package and account for customizations of users environments


I have a managed package which includes triggers and other bits of code which work with sObjects.

In my unit tests for the package I do inserts in say the Accounts sObject. But when a user who has customized the the Accounts sObject with validation rules tries to install my package he/she gets an error because the values my tests insert do not pass his/her validation rules.


Could you please advise of the best practices in this kind of situation.