File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ describe('ImageUtils', function() {
3
3
var
4
4
OBJECT = 'object' ,
5
5
TYPE_CANVAS = '[object HTMLCanvasElement]' ,
6
- TYPE_IMAGE_DATA = '[object ImageData]' ;
6
+ TYPE_IMAGE_DATA = '[object ImageData]' ,
7
+ E_TYPE = { name : 'ImageTypeError' , message : 'Submitted object was not an image.' } ;
7
8
8
9
function getContext ( ) {
9
10
var
@@ -140,12 +141,9 @@ describe('ImageUtils', function() {
140
141
} ) ;
141
142
142
143
it ( 'should fail on non-ImageType' , function ( ) {
143
- var
144
- e = { name : 'ImageTypeError' , message : 'Submitted object was not an image.' } ;
145
-
146
- expect ( function ( ) { imagediff . toImageData ( ) } ) . toThrow ( e ) ;
147
- expect ( function ( ) { imagediff . toImageData ( '' ) } ) . toThrow ( e ) ;
148
- expect ( function ( ) { imagediff . toImageData ( { } ) } ) . toThrow ( e ) ;
144
+ expect ( function ( ) { imagediff . toImageData ( ) } ) . toThrow ( E_TYPE ) ;
145
+ expect ( function ( ) { imagediff . toImageData ( '' ) } ) . toThrow ( E_TYPE ) ;
146
+ expect ( function ( ) { imagediff . toImageData ( { } ) } ) . toThrow ( E_TYPE ) ;
149
147
} ) ;
150
148
} ) ;
151
149
} ) ;
You can’t perform that action at this time.
0 commit comments