File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
packages/babel-plugin-transform-jsx-to-tagged-templates/test Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,30 @@ describe('babel-plugin-transform-jsx-to-tagged-templates', () => {
2424 ) . toBe ( 'const Foo = () => html`<div class="foo" draggable>\n <h1>Hello</h1>\n <p>world.</p>\n</div>`;' ) ;
2525 } ) ;
2626
27+ describe ( 'props' , ( ) => {
28+ test ( 'static values' , ( ) => {
29+ expect (
30+ transform ( '(<div a="a" b="bb" c d />);' , {
31+ babelrc : false ,
32+ plugins : [
33+ transformJsxToTaggedTemplatesPlugin
34+ ]
35+ } ) . code
36+ ) . toBe ( 'html`<div a="a" b="bb" c d/>`;' ) ;
37+ } ) ;
38+
39+ test ( 'expression values' , ( ) => {
40+ expect (
41+ transform ( 'const Foo = (props, a) => <div a={a} b={"b"} c={{}} d={props.d} e />;' , {
42+ babelrc : false ,
43+ plugins : [
44+ transformJsxToTaggedTemplatesPlugin
45+ ]
46+ } ) . code
47+ ) . toBe ( 'const Foo = (props, a) => html`<div a=${a} b=${"b"} c=${{}} d=${props.d} e/>`;' ) ;
48+ } ) ;
49+ } ) ;
50+
2751 test ( 'whitespace' , ( ) => {
2852 expect (
2953 transform ( 'const Foo = props => <div a b> a <em> b </em> c <strong> d </strong> e </div>;' , {
You can’t perform that action at this time.
0 commit comments