File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -59,16 +59,18 @@ describe("Svg to Image", function () {
5959 '</svg>'
6060 ) ;
6161
62- svg2image . renderSvg ( twoColorSvg , null ) . then ( function ( image ) {
63- // This fails in Chrome & Safari, possibly due to a bug with same origin policy stuff
64- try {
65- expect ( image ) . toImageDiffEqual ( referenceImg ) ;
66- } catch ( err ) {
67- expect ( err . message ) . toBeNull ( ) ;
68- }
62+ referenceImg . onload = function ( ) {
63+ svg2image . renderSvg ( twoColorSvg , null ) . then ( function ( image ) {
64+ // This fails in Safari, possibly due to a bug with same origin policy stuff
65+ try {
66+ expect ( image ) . toImageDiffEqual ( referenceImg ) ;
67+ } catch ( err ) {
68+ expect ( err ) . toBeNull ( ) ;
69+ }
6970
70- done ( ) ;
71- } ) ;
71+ done ( ) ;
72+ } ) ;
73+ } ;
7274 } ) ;
7375
7476 it ( "should return an error when the SVG cannot be rendered" , function ( done ) {
You can’t perform that action at this time.
0 commit comments