Closed BarredEwe closed 1 year ago
It was difficult, but finally I managed to add delay and precision for snapshots. I have added a function:
struct TestView_Previews: PrefireProvider { static var previews: some View { TestView() .snapshot(delay: 0.1, precision: 1) } }
This function affects snapshot generation, transit delay, and precision.:
// Generated snapshot test assertSnapshot( matching: view, as: .wait(for: delay, on: .image(precision: precision ?? 1, layout: isScreen ? .device(config: device) : .sizeThatFits)), named: preview.displayName, testName: testName )
I made this improvement based on the idea from this issue: https://github.com/BarredEwe/Prefire/issues/11
It was difficult, but finally I managed to add delay and precision for snapshots. I have added a function:
This function affects snapshot generation, transit delay, and precision.: