66 * Module dependencies.
77 */
88
9- const { createCanvas, loadImage} = require ( '../' ) ;
9+ const { createCanvas, loadImage, rsvgVersion } = require ( '../' ) ;
1010const Image = require ( '../' ) . Image
11+ const HAVE_SVG = rsvgVersion !== undefined ;
1112
1213const assert = require ( 'assert' )
1314const assertRejects = require ( 'assert-rejects' )
@@ -85,12 +86,14 @@ describe('Image', function () {
8586 } )
8687
8788 it ( 'detects invalid PNG' , function ( done ) {
89+ if ( process . platform === 'win32' ) this . skip ( ) ; // TODO
8890 const img = new Image ( )
8991 img . onerror = ( ) => done ( )
9092 img . src = Buffer . from ( '89504E470D' , 'hex' )
9193 } )
9294
9395 it ( 'loads SVG data URL base64' , function ( ) {
96+ if ( ! HAVE_SVG ) this . skip ( ) ;
9497 const base64Enc = fs . readFileSync ( svg_tree , 'base64' )
9598 const dataURL = `data:image/svg+xml;base64,${ base64Enc } `
9699 return loadImage ( dataURL ) . then ( ( img ) => {
@@ -103,6 +106,7 @@ describe('Image', function () {
103106 } )
104107
105108 it ( 'loads SVG data URL utf8' , function ( ) {
109+ if ( ! HAVE_SVG ) this . skip ( ) ;
106110 const utf8Encoded = fs . readFileSync ( svg_tree , 'utf8' )
107111 const dataURL = `data:image/svg+xml;utf8,${ utf8Encoded } `
108112 return loadImage ( dataURL ) . then ( ( img ) => {
0 commit comments