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
Copy file name to clipboardExpand all lines: Tests/JSONAPITests/Document/DocumentDecodingErrorTests.swift
+3-17Lines changed: 3 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ final class DocumentDecodingErrorTests: XCTestCase {
92
92
return
93
93
}
94
94
95
-
XCTAssertEqual(String(describing: error),#"Out of 3 includes, the 3rd one 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""#)
96
96
}
97
97
}
98
98
@@ -112,14 +112,7 @@ final class DocumentDecodingErrorTests: XCTestCase {
112
112
113
113
XCTAssertEqual(
114
114
String(describing: error),
115
-
#"""
116
-
Out of 3 includes, the 3rd one failed to parse:
117
-
Could not have been Include Type `articles` because:
118
-
found JSON:API type "not_an_author" but expected "articles"
119
-
120
-
Could not have been Include Type `authors` because:
121
-
found JSON:API type "not_an_author" but expected "authors"
122
-
"""#
115
+
"Out of the 3 includes in the document, the 3rd one failed to parse: Found JSON:API type 'not_an_author' but expected one of 'articles', 'authors'"
123
116
)
124
117
}
125
118
}
@@ -140,14 +133,7 @@ final class DocumentDecodingErrorTests: XCTestCase {
140
133
141
134
XCTAssertEqual(
142
135
String(describing: error),
143
-
#"""
144
-
Out of 3 includes, the 2nd one failed to parse:
145
-
Could not have been Include Type `articles` because:
146
-
found JSON:API type "not_an_author" but expected "articles"
147
-
148
-
Could not have been Include Type `authors` because:
149
-
found JSON:API type "not_an_author" but expected "authors"
150
-
"""#
136
+
"Out of the 3 includes in the document, the 2nd one failed to parse: Found JSON:API type 'not_an_author' but expected one of 'articles', 'authors'"
Out of 3 includes, the 3rd one failed to parse: \nCould not have been Include Type `test_entity1` because:
23
-
found JSON:API type "test_entity4" but expected "test_entity1"
24
-
25
-
Could not have been Include Type `test_entity2` because:
26
-
found JSON:API type "test_entity4" but expected "test_entity2"
27
-
"""
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'"
28
22
)
29
23
}
30
24
31
25
// now test that we get the same error with a different total include count from a different test stub
Out of 4 includes, the 3rd one failed to parse: \nCould not have been Include Type `test_entity1` because:
37
-
found JSON:API type "test_entity4" but expected "test_entity1"
38
-
39
-
Could not have been Include Type `test_entity2` because:
40
-
found JSON:API type "test_entity4" but expected "test_entity2"
41
-
"""
29
+
"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 6 includes, the 5th one failed to parse: \nCould not have been Include Type `test_entity1` because:
51
-
found JSON:API type "test_entity4" but expected "test_entity1"
52
-
53
-
Could not have been Include Type `test_entity2` because:
54
-
found JSON:API type "test_entity4" but expected "test_entity2"
55
-
"""
37
+
"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'"
56
38
)
57
39
}
58
40
59
41
// and with a number of total includes between 10 and 19
Out of 11 includes, the 10th one failed to parse: \nCould not have been Include Type `test_entity1` because:
65
-
found JSON:API type "test_entity4" but expected "test_entity1"
66
-
67
-
Could not have been Include Type `test_entity2` because:
68
-
found JSON:API type "test_entity4" but expected "test_entity2"
69
-
"""
45
+
"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'"
70
46
)
71
47
}
72
48
73
49
// and finally with a larger number of total includes
Out of 22 includes, the 21st one failed to parse: \nCould not have been Include Type `test_entity1` because:
79
-
found JSON:API type "test_entity4" but expected "test_entity1"
80
-
81
-
Could not have been Include Type `test_entity2` because:
82
-
found JSON:API type "test_entity4" but expected "test_entity2"
83
-
"""
53
+
"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'"
84
54
)
85
55
}
86
56
}
@@ -94,16 +64,7 @@ final class IncludesDecodingErrorTests: XCTestCase {
0 commit comments