Should Unit Tests be executed in the live production environment or only in development?

Unit tests should only be executed in the development environment, not in the live production environment. Running unit tests in production can potentially disrupt the live system and cause unexpected issues for users. It is best practice to run unit tests during the development phase to catch bugs and ensure the code functions as expected before deploying it to production.

// Example of running unit tests in the development environment
if (ENVIRONMENT === 'development') {
    // Run unit tests here
    runUnitTests();
}