hmlongco / Factory

A new approach to Container-Based Dependency Injection for Swift and SwiftUI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FactoryContext.test not detected in SPM tests

mbrandonw opened this issue · comments

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.

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