Skip to content

XCTUnimplemented placeholder .none vs. Effect.none #26

@rcarver

Description

@rcarver

With TCA, when you used XCTUnimplemented to stub out a function returning an Effect I instinctively use placeholder: .none and then get surprised when it fatal errors. You have to explicitly use Effect.none to get a nice test error instead.

struct Client {
    var perform: () -> Effect<Void, Never>
    static let unimplemented1 = Self(
        perform: XCTUnimplemented("perform", placeholder: .none)
    )
    static let unimplemented2 = Self(
        perform: XCTUnimplemented("perform", placeholder: Effect.none)
    )
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions