Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save tedgonzalez/d2178c35e8d14898b93fadf9c4319f81 to your computer and use it in GitHub Desktop.

Select an option

Save tedgonzalez/d2178c35e8d14898b93fadf9c4319f81 to your computer and use it in GitHub Desktop.
func testDecodingUnknownOrderItemsThrowsAnError() throws {
let givenJsonData = #"""
[
"unknownDelivery": "unknownValue"
]
"""#.data(using: .utf8)!
XCTAssertThrowsError(try decoder.decode([OrderItem].self, from: givenJsonData))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment