Fix tests

This commit is contained in:
Juriy Zaytsev 2015-07-20 13:53:38 -04:00
parent 614878d133
commit bd09021b3b
2 changed files with 34 additions and 2 deletions

View file

@ -83,7 +83,11 @@
'filters': [],
'fillRule': 'nonzero',
'globalCompositeOperation': 'source-over',
'transformMatrix': null
'transformMatrix': null,
'crossOrigin': '',
'alignX': 'none',
'alignY': 'none',
'meetOrSlice': 'meet'
};
function _createImageElement() {

View file

@ -43,7 +43,11 @@
'filters': [],
'fillRule': 'nonzero',
'globalCompositeOperation': 'source-over',
'transformMatrix': null
'transformMatrix': null,
'crossOrigin': '',
'alignX': 'none',
'alignY': 'none',
'meetOrSlice': 'meet'
};
function _createImageElement() {
@ -133,6 +137,30 @@
});
});
// asyncTest('toObject without default values', function() {
// createImageObject(function(image) {
// image.includeDefaultValues = false;
// var object = image.toObject();
// // workaround for node-canvas sometimes producing images with width/height and sometimes not
// if (object.width === 0) {
// object.width = IMG_WIDTH;
// }
// if (object.height === 0) {
// object.height = IMG_HEIGHT;
// }
// deepEqual(object, {
// type: 'image',
// // why the hell deepEqual fail [] == [] check?!
// filters: [],
// crossOrigin: ''
// });
// start();
// });
// });
asyncTest('toString', function() {
createImageObject(function(image) {
ok(typeof image.toString == 'function');