File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -19,4 +19,34 @@ describe('aspect ratio', () => {
19
19
it ( 'using other separator' , ( ) => {
20
20
should ( aspectRatio ( 1920 , 1080 , '/' ) ) . equal ( '16/9' )
21
21
} )
22
+
23
+ it ( 'invalid width' , ( ) => {
24
+ let error = ''
25
+ try {
26
+ should ( aspectRatio ( 1920 , null , '/' ) ) . equal ( '16/9' )
27
+ } catch ( e ) {
28
+ error = e . message
29
+ }
30
+ should ( error ) . equal ( 'Invalid width: null' )
31
+ } )
32
+
33
+ it ( 'invalid height' , ( ) => {
34
+ let error = ''
35
+ try {
36
+ should ( aspectRatio ( null , 1080 , '/' ) ) . equal ( '16/9' )
37
+ } catch ( e ) {
38
+ error = e . message
39
+ }
40
+ should ( error ) . equal ( 'Invalid height: null' )
41
+ } )
42
+
43
+ it ( 'invalid width & height' , ( ) => {
44
+ let error = ''
45
+ try {
46
+ should ( aspectRatio ( null , null ) ) . equal ( '16/9' )
47
+ } catch ( e ) {
48
+ error = e . message
49
+ }
50
+ should ( error ) . equal ( 'Invalid height: null' )
51
+ } )
22
52
} )
You can’t perform that action at this time.
0 commit comments