Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 661 Bytes

README.md

File metadata and controls

32 lines (23 loc) · 661 Bytes

Mockingjay

SPM

Mockingjay simplifies creating mock objects in Swift.

Usage

Calling Mockingjay.mock() creates a new object of given type.

    struct Cat: Codable, Equatable {
        let age: Int
        let name: String
        let speed: Double
        let children: [CatChild]
        let parent: CatParent

        enum CatChild: String, Codable {
            case one
            case two
            case three
        }
    }

    struct CatParent: Codable, Equatable {
        let parentId: String
    }

    let mock: Cat? = try Mockingjay.mock()