Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
Node 0.12 support
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Apr 17, 2018
1 parent 18d32fe commit 80d57ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,16 @@ describe( 'rollup-pluginutils', function () {
var dataToNamedExports = utils.dataToNamedExports;

it( 'outputs treeshakable data', function () {
assert.equal( dataToNamedExports({ some: 'data', another: 'data' }), `export const some = "data";\nexport const another = "data";\nexport default {\n some,\n another\n};` );
assert.equal( dataToNamedExports({ some: 'data', another: 'data' }), 'export const some = "data";\nexport const another = "data";\nexport default {\n some,\n another\n};' );
});

it( 'handles illegal identifiers', function () {
assert.equal( dataToNamedExports({ '1': 'data', 'default': 'data' }), `export const _1 = "data";\nexport const _default = "data";\nexport default {\n '1': _1,\n 'default': _default\n};` );
assert.equal( dataToNamedExports({ '1': 'data', 'default': 'data' }), 'export const _1 = "data";\nexport const _default = "data";\nexport default {\n \'1\': _1,\n \'default\': _default\n};' );
});

it( 'supports non-JSON data', function () {
const date = new Date();
assert.equal( dataToNamedExports({ inf: Infinity, date }), `export const inf = Infinity;\nexport const date = new Date(${date.getTime()});\nexport default {\n inf,\n date\n};` );
assert.equal( dataToNamedExports({ inf: Infinity, date: date }), 'export const inf = Infinity;\nexport const date = new Date(' + date.getTime() + ');\nexport default {\n inf,\n date\n};' );
});
});
});

0 comments on commit 80d57ea

Please sign in to comment.