Inspired by Robert O'Callahan's blog
To reduce the need for "visual confirmation" tests:
- store the base-64 encoded data-uri of a reference png as a string
- copy the outerHTML of your test fixture into an SVG wrapper, prefixed with "data:image/svg+xml,"
- set the src of an image to the value of the SVG wrapper
- copy the image into a canvas context
- assert equality of canvas.context.toDataURL() and previously stored reference string