Replies: 2 comments 4 replies
-
To anyone interested, the issue is caused by the following method in the
This method is only called when the state conforms to The issue can be workaround by conforming |
Beta Was this translation helpful? Give feedback.
-
Hi @OguzYuuksel, can you explain a bit why you are trying to snapshot test a SwiftUI view struct with the The crash seems to be an infinite loop, somehow related to the internals of the While ideally we would fix this infinite loop, we don't really consider it a priority because we just don't think there is any value to snapshotting these objects with Alternatively, it does not seem that our Since this isn't really a problem with this library I am going to convert it to a discussion. Feel free to discuss more over there! |
Beta Was this translation helpful? Give feedback.
-
Description
I am trying to write a unit test that will snapshot a View that has an observableState reducer, however doing so causes bad access. I have produced a simple example to reproduce this below:
View and Reducer:
Unit test:
Test:
Checklist
main
branch of this package.Expected behavior
The test runs and passes or fails
Actual behavior
The test crashes with
Thread 1: EXC_BAD_ACCESS (code=2, address=0x16cbdbbe8)
onlet mirror = Mirror(reflecting: value)
inprivate func snap<T>(_ value: T, name: String? = nil, indent: Int = 0) -> String {...
in the Snapshotting classReproducing project
No response
The Composable Architecture version information
1.16.1
Destination operating system
iOS 18 iPhone 16 Pro sim
Xcode version information
Xcode 16.2
Swift Compiler version information
No response
Beta Was this translation helpful? Give feedback.
All reactions