Skip to content

Commit 7fae46c

Browse files
committed
Fix testFetchSubscription to make edits in repositoryContext
non-main-queue
1 parent 53268f0 commit 7fae46c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Tests/CoreDataRepositoryTests/FetchRepositoryTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ final class FetchRepositoryTests: CoreDataXCTestCase {
9696
})
9797
.store(in: &cancellables)
9898
wait(for: [firstExp], timeout: 5)
99-
try viewContext().performAndWait {
99+
try repositoryContext().performAndWait {
100100
do {
101101
let objectId = try container().persistentStoreCoordinator
102102
.managedObjectID(forURIRepresentation: try XCTUnwrap(expectedMovies.last?.url))
103-
try viewContext().delete(try viewContext().object(with: try XCTUnwrap(objectId)))
104-
try viewContext().save()
103+
try repositoryContext().delete(try repositoryContext().object(with: try XCTUnwrap(objectId)))
104+
try repositoryContext().save()
105105
} catch {
106106
XCTFail("Failed to update repository: \(error.localizedDescription)")
107107
}

0 commit comments

Comments
 (0)