@@ -60,15 +60,21 @@ describe('ParseFile', () => {
60
60
process . env . PARSE_BUILD = 'node' ;
61
61
} ) ;
62
62
63
- it ( 'can create files with base64 encoding' , ( ) => {
64
- const file = new ParseFile ( 'parse.txt' , { base64 : 'ParseA== ' } ) ;
65
- expect ( file . _source . base64 ) . toBe ( 'ParseA== ' ) ;
63
+ it ( 'can create files with base64 encoding (no padding) ' , ( ) => {
64
+ const file = new ParseFile ( 'parse.txt' , { base64 : 'YWJj ' } ) ;
65
+ expect ( file . _source . base64 ) . toBe ( 'YWJj ' ) ;
66
66
expect ( file . _source . type ) . toBe ( '' ) ;
67
67
} ) ;
68
68
69
- it ( 'can create files with base64 encoding (no padding)' , ( ) => {
70
- const file = new ParseFile ( 'parse.txt' , { base64 : 'SGVsbG8gV29ybGQh' } ) ;
71
- expect ( file . _source . base64 ) . toBe ( 'SGVsbG8gV29ybGQh' ) ;
69
+ it ( 'can create files with base64 encoding (1 padding)' , ( ) => {
70
+ const file = new ParseFile ( 'parse.txt' , { base64 : 'YWI=' } ) ;
71
+ expect ( file . _source . base64 ) . toBe ( 'YWI=' ) ;
72
+ expect ( file . _source . type ) . toBe ( '' ) ;
73
+ } ) ;
74
+
75
+ it ( 'can create files with base64 encoding (2 padding)' , ( ) => {
76
+ const file = new ParseFile ( 'parse.txt' , { base64 : 'ParseA==' } ) ;
77
+ expect ( file . _source . base64 ) . toBe ( 'ParseA==' ) ;
72
78
expect ( file . _source . type ) . toBe ( '' ) ;
73
79
} ) ;
74
80
0 commit comments