XCTFail
call should include a description of the assertion SW-R1032When a test case fails, the XCTFail call is used to indicate the failure. However, without a description, it becomes challenging to determine the specific reason for the failure. This can lead to confusion and increase debugging time, especially when multiple assertions are present in the same test case.
It is recommended to always include a descriptive message when using XCTFail to provide clarity and context for failed assertions.
func testFoo() {
XCTFail()
}
func testFoo() {
XCTFail("The test `testFoo` is failed")
}