Skip to content

Check if code is running in tests #9

Description

@fespinoza

Sometimes some fixes are needed only for test targets

if ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"] != nil {
    // Code only executes when tests are running
}

Source: https://stackoverflow.com/a/29991529/611678

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions