@@ -630,6 +630,40 @@ module.exports = {
630630 } ) ;
631631 } ) ;
632632
633+ it ( 'When enabled, preact JSX is transformed without preact-compat!' , ( done ) => {
634+ const config = createWebpackConfig ( 'www/build' , 'dev' ) ;
635+ config . setPublicPath ( '/build' ) ;
636+ config . addEntry ( 'main' , './js/CoolReactComponent.jsx' ) ;
637+ config . enablePreactPreset ( ) ;
638+
639+ testSetup . runWebpack ( config , ( webpackAssert ) => {
640+ // check that babel transformed the JSX
641+ webpackAssert . assertOutputFileContains (
642+ 'main.js' ,
643+ 'var hiGuys = h('
644+ ) ;
645+
646+ done ( ) ;
647+ } ) ;
648+ } ) ;
649+
650+ it ( 'When enabled, preact JSX is transformed with preact-compat!' , ( done ) => {
651+ const config = createWebpackConfig ( 'www/build' , 'dev' ) ;
652+ config . setPublicPath ( '/build' ) ;
653+ config . addEntry ( 'main' , './js/CoolReactComponent.jsx' ) ;
654+ config . enablePreactPreset ( true ) ;
655+
656+ testSetup . runWebpack ( config , ( webpackAssert ) => {
657+ // check that babel transformed the JSX
658+ webpackAssert . assertOutputFileContains (
659+ 'main.js' ,
660+ 'React.createElement'
661+ ) ;
662+
663+ done ( ) ;
664+ } ) ;
665+ } ) ;
666+
633667 it ( 'When configured, TypeScript is compiled!' , ( done ) => {
634668 const config = createWebpackConfig ( 'www/build' , 'dev' ) ;
635669 config . setPublicPath ( '/build' ) ;
0 commit comments