I'm curious as to what you found, I have the exact same question. Also sort of fascinating, I proposed the question to ChatGPT, and it provided links that sounded promising, but all of which were 404 not found links:
___"Test-Driven Development with CloudKit and SwiftUI" by Craig Clayton on the Ray Wenderlich website: This tutorial covers how to use Test Driven Development with CloudKit and SwiftUI. It includes examples of setting up a test environment, creating mock data, and writing unit tests for CloudKit code. Link: https://www.raywenderlich.com/9700429-test-driven-development-with-cloudkit-and-swiftui
"Testing with CloudKit" by John Sundell on the Swift by Sundell website: This article covers how to test CloudKit code using XCTest. It includes examples of mocking CloudKit dependencies, writing unit tests for CloudKit operations, and using test doubles. Link: https://www.swiftbysundell.com/articles/testing-with-cloudkit/
"Unit Testing CloudKit Operations in Swift" by Kushagra Verma on the Medium website: This article covers how to use Test Driven Development to write unit tests for CloudKit operations such as fetching records and handling errors. It includes examples of setting up a test environment, creating mock data, and writing unit tests using XCTest. Link: https://kushagra.dev/posts/unit-testing-cloudkit-operations-in-swift/
"CloudKit and Test Driven Development" by David Kittell on the Thoughtbot website: This article covers how to use Test Driven Development with CloudKit. It includes examples of writing unit tests for CloudKit operations using XCTest, and using mock objects to isolate CloudKit code from other parts of your app. Link: https://thoughtbot.com/blog/cloudkit-and-test-driven-development___
Each of these sounds tantalizingly like exactly what I'm looking for, but I have been unsuccessful finding the information anywhere online, even given the author's names and looking on the Swift by Sundell website, etc. If you found anything that provides guidance or wisdom, please let me know! Many thanks.
Bob