From 9f399591b3a48bfac5b09e83911fdc15a63e58d2 Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Sun, 19 Jun 2016 11:04:20 -0400 Subject: [PATCH] add test for es6 format warning --- test/test.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/test/test.js b/test/test.js index 639104e..f8c112e 100644 --- a/test/test.js +++ b/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 () {