You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -91,11 +92,12 @@ final class DocumentDecodingErrorTests: XCTestCase {
91
92
return
92
93
}
93
94
94
-
XCTAssertEqual(String(describing: error),#"Include 3 failed to parse: found JSON:API type "not_an_author" but expected "authors""#)
95
+
XCTAssertEqual(String(describing: error),#"Out of the 3 includes in the document, the 3rd one failed to parse: found JSON:API type "not_an_author" but expected "authors""#)
95
96
}
96
97
}
97
98
98
99
func test_include_failure2(){
100
+
// test that if there are two possiblie includes, we find out why each of them was not possible to decode.
Include 3 failed to parse: \nCould not have been Include Type 1 because:
24
-
found JSON:API type "test_entity4" but expected "test_entity1"
21
+
"Out of the 3 includes in the document, the 3rd one failed to parse: Found JSON:API type 'test_entity4' but expected one of 'test_entity1', 'test_entity2'"
22
+
)
23
+
}
25
24
26
-
Could not have been Include Type 2 because:
27
-
found JSON:API type "test_entity4" but expected "test_entity2"
28
-
"""
25
+
// now test that we get the same error with a different total include count from a different test stub
"Out of the 4 includes in the document, the 3rd one failed to parse: Found JSON:API type 'test_entity4' but expected one of 'test_entity1', 'test_entity2'"
"Out of the 6 includes in the document, the 5th one failed to parse: Found JSON:API type 'test_entity4' but expected one of 'test_entity1', 'test_entity2'"
38
+
)
32
39
}
33
40
34
-
// now test that we get the same error from a different test stub
"Out of the 11 includes in the document, the 10th one failed to parse: Found JSON:API type 'test_entity4' but expected one of 'test_entity1', 'test_entity2'"
46
+
)
47
+
}
48
+
49
+
// and finally with a larger number of total includes
"Out of the 22 includes in the document, the 21st one failed to parse: Found JSON:API type 'test_entity4' but expected one of 'test_entity1', 'test_entity2'"
0 commit comments