79373626

Date: 2025-01-21 08:23:35
Score: 2
Natty:
Report link

Why not check processName that seems to always be xctest when running unit-tests.

var isRunningUnitTests: Bool {
    ProcessInfo.processInfo.processName == "xctest"
}
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Starts with a question (0.5): Why not
  • Low reputation (1):
Posted by: Pace