@@ -447,16 +447,21 @@ describe( 'rollup-pluginutils', function () {
447
447
var dataToEsm = utils . dataToEsm ;
448
448
449
449
it ( 'outputs treeshakable data' , function ( ) {
450
- assert . equal ( dataToEsm ( { some : 'data' , another : 'data' } ) , 'export const some = "data";\nexport const another = "data";\nexport default {\n some,\n another\n};' ) ;
450
+ assert . equal ( dataToEsm ( { some : 'data' , another : 'data' } ) , 'export const some = "data";\nexport const another = "data";\nexport default {\n some,\n another\n};' ) ;
451
451
} ) ;
452
452
453
453
it ( 'handles illegal identifiers' , function ( ) {
454
- assert . equal ( dataToEsm ( { '1' : 'data' , 'default' : 'data' } ) , 'export const _1 = "data";\nexport const _default = "data";\nexport default {\n \'1\': _1,\n \'default\': _default\n};' ) ;
454
+ assert . equal ( dataToEsm ( { '1' : 'data' , 'default' : 'data' } ) , 'export const _1 = "data";\nexport const _default = "data";\nexport default {\n \'1\': _1,\n \'default\': _default\n};' ) ;
455
455
} ) ;
456
456
457
457
it ( 'supports non-JSON data' , function ( ) {
458
458
const date = new Date ( ) ;
459
- assert . equal ( dataToEsm ( { inf : Infinity , date : date } ) , 'export const inf = Infinity;\nexport const date = new Date(' + date . getTime ( ) + ');\nexport default {\n inf,\n date\n};' ) ;
459
+ assert . equal ( dataToEsm ( { inf : Infinity , date : date } ) , 'export const inf = Infinity;\nexport const date = new Date(' + date . getTime ( ) + ');\nexport default {\n inf,\n date\n};' ) ;
460
+ } ) ;
461
+
462
+ it ( 'supports a compact argument' , function ( ) {
463
+ assert . equal ( dataToEsm ( { some : 'data' , another : 'data' } , true ) , 'export const some="data";export const another="data";export default{some,another};' ) ;
464
+ assert . equal ( dataToEsm ( { some : { deep : { object : 'definition' , here : 'here' } } , another : 'data' } , true ) , 'export const some={deep:{object:"definition",here:"here"}};export const another="data";export default{some,another};' ) ;
460
465
} ) ;
461
466
} ) ;
462
467
} ) ;
0 commit comments