@@ -595,42 +595,39 @@ test('works as a CJS plugin', async () => {
595595 expect ( code . includes ( 'const' ) ) . toBe ( false ) ;
596596} ) ;
597597
598- test ( 'works in parallel' , async ( t ) => {
598+ test ( 'works in parallel' , async ( ) => {
599599 const bundle = await rollup ( {
600600 input : `${ FIXTURES } proposal-decorators/main.js` ,
601601 plugins : [ babelPlugin ( { parallel : true } ) ]
602602 } ) ;
603603 const code = await getCode ( bundle ) ;
604604
605- t . true ( code . includes ( '_createClass' ) , 'decorator was applied' ) ;
605+ expect ( code . includes ( '_createClass' ) ) . toBe ( true ) ;
606606} ) ;
607607
608- test ( 'works in parallel with specified worker count' , async ( t ) => {
608+ test ( 'works in parallel with specified worker count' , async ( ) => {
609609 const code = await generate ( 'basic/main.js' , { parallel : 2 } ) ;
610- t . false ( code . includes ( 'const' ) ) ;
611- t . true ( code . includes ( 'var answer = 42' ) ) ;
612- } ) ;
613-
614- test ( 'throws when using parallel with non-serializable babel options' , async ( t ) => {
615- await t . throwsAsync (
616- ( ) =>
617- generate ( 'basic/main.js' , {
618- parallel : true ,
619- plugins : [
620- // Functions are not serializable
621- function customPlugin ( ) {
622- return { visitor : { } } ;
623- }
624- ]
625- } ) ,
626- {
627- message :
628- / C a n n o t u s e " p a r a l l e l " m o d e a l o n g s i d e c u s t o m o v e r r i d e s o r n o n - s e r i a l i z a b l e B a b e l o p t i o n s /
629- }
610+ expect ( code . includes ( 'const' ) ) . toBe ( false ) ;
611+ expect ( code . includes ( 'var answer = 42' ) ) . toBe ( true ) ;
612+ } ) ;
613+
614+ test ( 'throws when using parallel with non-serializable babel options' , async ( ) => {
615+ await expect ( ( ) =>
616+ generate ( 'basic/main.js' , {
617+ parallel : true ,
618+ plugins : [
619+ // Functions are not serializable
620+ function customPlugin ( ) {
621+ return { visitor : { } } ;
622+ }
623+ ]
624+ } )
625+ ) . rejects . toThrow (
626+ / C a n n o t u s e " p a r a l l e l " m o d e a l o n g s i d e c u s t o m o v e r r i d e s o r n o n - s e r i a l i z a b l e B a b e l o p t i o n s /
630627 ) ;
631628} ) ;
632629
633- test ( 'throws when using parallel with config override' , ( t ) => {
630+ test ( 'throws when using parallel with config override' , ( ) => {
634631 const customBabelPlugin = createBabelInputPluginFactory ( ( ) => {
635632 return {
636633 config ( cfg ) {
@@ -639,13 +636,12 @@ test('throws when using parallel with config override', (t) => {
639636 } ;
640637 } ) ;
641638
642- t . throws ( ( ) => customBabelPlugin ( { babelHelpers : 'bundled' , parallel : true } ) , {
643- message :
644- / C a n n o t u s e " p a r a l l e l " m o d e a l o n g s i d e c u s t o m o v e r r i d e s o r n o n - s e r i a l i z a b l e B a b e l o p t i o n s /
645- } ) ;
639+ expect ( ( ) => customBabelPlugin ( { babelHelpers : 'bundled' , parallel : true } ) ) . toThrow (
640+ / C a n n o t u s e " p a r a l l e l " m o d e a l o n g s i d e c u s t o m o v e r r i d e s o r n o n - s e r i a l i z a b l e B a b e l o p t i o n s /
641+ ) ;
646642} ) ;
647643
648- test ( 'throws when using parallel with result override' , ( t ) => {
644+ test ( 'throws when using parallel with result override' , ( ) => {
649645 const customBabelPlugin = createBabelInputPluginFactory ( ( ) => {
650646 return {
651647 result ( result ) {
@@ -654,8 +650,7 @@ test('throws when using parallel with result override', (t) => {
654650 } ;
655651 } ) ;
656652
657- t . throws ( ( ) => customBabelPlugin ( { babelHelpers : 'bundled' , parallel : true } ) , {
658- message :
659- / C a n n o t u s e " p a r a l l e l " m o d e a l o n g s i d e c u s t o m o v e r r i d e s o r n o n - s e r i a l i z a b l e B a b e l o p t i o n s /
660- } ) ;
653+ expect ( ( ) => customBabelPlugin ( { babelHelpers : 'bundled' , parallel : true } ) ) . toThrow (
654+ / C a n n o t u s e " p a r a l l e l " m o d e a l o n g s i d e c u s t o m o v e r r i d e s o r n o n - s e r i a l i z a b l e B a b e l o p t i o n s /
655+ ) ;
661656} ) ;
0 commit comments