Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benStre committed Sep 3, 2024
1 parent c2956a4 commit c0cd22f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
22 changes: 20 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ test!(
t13,
r#"<div>
{
x ? <span>{ x + 1 }</span> : <span>False</span>
x ?
<span>{ x + 1 }</span> :
<span>False</span>
}
</div>"#
);
Expand Down Expand Up @@ -350,4 +352,20 @@ test!(
1,2,3
])
"#
);
);


test!(
Syntax::Es(EsSyntax {
jsx: true,
..Default::default()
},),
|_| TransformVisitor,
t29,
r#"
export default <div>
Count is {count + 1}
</div>;
"#
);

2 changes: 1 addition & 1 deletion tests/__swc_snapshots__/src/lib.rs/t14.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div>{prop(x, "title")}</div>;
<div>{prop(x, "title")}</div>;
2 changes: 1 addition & 1 deletion tests/__swc_snapshots__/src/lib.rs/t2.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
const y = _$(()=>y * 2);
const y = _$(()=>y * 2);
2 changes: 1 addition & 1 deletion tests/__swc_snapshots__/src/lib.rs/t21.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<input value={prop(prop(prop(x, "y"), "z"), 0)}/>;
<input value={prop(prop(prop(x, "y"), "z"), 0)}/>;
3 changes: 3 additions & 0 deletions tests/__swc_snapshots__/src/lib.rs/t29.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default <div>
Count is {_$(()=>count + 1)}
</div>;

0 comments on commit c0cd22f

Please sign in to comment.