@@ -91,13 +91,6 @@ describe('rollup-plugin-babel', function() {
9191 } ) ;
9292 } ) ;
9393
94- it ( 'does not add helpers when externalHelpers option is truthy' , ( ) => {
95- return bundle ( 'samples/class/main.js' ) . then ( ( { code } ) => {
96- assert . ok ( code . indexOf ( 'babelHelpers =' ) === - 1 , code ) ;
97- assert . ok ( code . indexOf ( `${ HELPERS } .classCallCheck =` ) === - 1 , code ) ;
98- } ) ;
99- } ) ;
100-
10194 it ( 'does not babelify excluded code' , ( ) => {
10295 return bundle ( 'samples/exclusions/main.js' , { exclude : '**/foo.js' } ) . then ( ( { code } ) => {
10396 assert . ok ( code . indexOf ( '${foo()}' ) === - 1 , code ) ;
@@ -188,14 +181,21 @@ describe('rollup-plugin-babel', function() {
188181 } ) ;
189182 } ) ;
190183
191- it ( 'warns about deprecated usage with external-helper plugin' , ( ) => {
184+ it ( 'allows using external-helpers plugin in combination with externalHelpers flag' , ( ) => {
185+ return bundle ( 'samples/external-helpers/main.js' , { externalHelpers : true } ) . then ( ( { code } ) => {
186+ assert . ok ( code . indexOf ( 'function _classCallCheck' ) === - 1 ) ;
187+ assert . ok ( code . indexOf ( 'babelHelpers.classCallCheck' ) !== - 1 ) ;
188+ } ) ;
189+ } ) ;
190+
191+ it ( 'warns about deprecated usage with external-helpers plugin (without externalHelpers flag)' , ( ) => {
192192 /* eslint-disable no-console */
193193 const messages = [ ] ;
194194 const originalWarn = console . warn ;
195195 console . warn = msg => {
196196 messages . push ( msg ) ;
197197 } ;
198- return bundle ( 'samples/external-helpers-deprecated /main.js' ) . then ( ( ) => {
198+ return bundle ( 'samples/external-helpers/main.js' ) . then ( ( ) => {
199199 console . warn = originalWarn ;
200200
201201 assert . deepEqual ( messages , [
0 commit comments