Browse Source

add test for es6 format warning

semi-dynamic-namespace-imports
Rich-Harris 9 years ago
parent
commit
9f399591b3
  1. 22
      test/test.js

22
test/test.js

@ -17,7 +17,7 @@ var CLI = path.resolve( __dirname, 'cli' );
var PROFILES = [
{ format: 'amd' },
{ format: 'cjs' },
{ format: 'es6' },
{ format: 'es' },
{ format: 'iife' },
{ format: 'umd' }
];
@ -125,6 +125,26 @@ describe( 'rollup', function () {
}, /You must supply options\.moduleName for IIFE bundles/ );
});
});
it( 'warns on es6 format', function () {
var warned;
return rollup.rollup({
entry: 'x',
plugins: [{
resolveId: function () { return 'test'; },
load: function () {
return '// empty';
}
}],
onwarn: function ( msg ) {
if ( /The es6 format is deprecated/.test( msg ) ) warned = true;
}
}).then( function ( bundle ) {
bundle.generate({ format: 'es6' });
assert.ok( warned );
});
});
});
describe( 'function', function () {

Loading…
Cancel
Save