hmlongco / Factory

A new approach to Container-Based Dependency Injection for Swift and SwiftUI.
MIT License
1.71k stars 107 forks source link

FactoryContext.test not detected in SPM tests #94

Closed mbrandonw closed 1 year ago

mbrandonw commented 1 year ago

If you run Factory's test suite through SPM using swift test (rather than through Xcode) you will find that 2 tests fail:

$ swift test

FactoryContextTests.swift:55: error: XCTAssertEqual failed: ("REGISTERED") is not equal to ("TEST")
FactoryContextTests.swift:57: error: XCTAssertEqual failed: ("DEBUG") is not equal to ("TEST")

This is because isTesting checks for an environment variable that Xcode provides, but swift from the command line does not.

hmlongco commented 1 year ago

Think this is fixed in current 2.1.3 pre-release on main.