Snap.swift
Snap.swift copied to clipboard
API to expect UIImage
It would be awesome if there would be an API to compare an UIImage to be able to visually inspect images, for example to test rendering code without creating full views.
Something like: expect(image: UIImage)
Current workaround: expect(UIImageView(image: image))
Hey @ralfebert, in which scenario you would compare against an image and not an actual view?
I have a method that generates a cgPath and I want to test it by drawing it using the UIGraphicsImageRenderer in specific configurations. And comparing images might be useful outside of view testing, like f.e. for testing a diagram renderer library that only generates images. Snap.swift does it anyway, why not offer something simple and powerful like XCTAssertEqualImage :)