test(es/parser): Add a test for a fixed issue (#4388)

This commit is contained in:
Donny/강동윤 2022-04-21 15:56:34 +09:00 committed by GitHub
parent a4c708858e
commit b9cba1ad4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,14 @@
{
"jsc": {
"transform": {
"hidden": {
"jest": true
}
},
"target": "es2022",
"parser": {
"syntax": "typescript",
"tsx": true
}
}
}

View File

@ -0,0 +1,29 @@
import React from "react";
interface ListProps {
callback: () => void;
}
const SomeList = ({ callback }: ListProps) => {
callback();
return <div />;
};
const list = [0];
const MyComponent = (): JSX.Element => {
return (
<div>
{list.map(() =>
true ? (
<SomeList
callback={(): void => console.log("do something")}
/>
) : (
<div />
)
)}
</div>
);
};

View File

@ -0,0 +1,14 @@
import React from "react";
const SomeList = ({ callback })=>{
callback();
return /*#__PURE__*/ React.createElement("div", null);
};
const list = [
0
];
const MyComponent = ()=>{
return /*#__PURE__*/ React.createElement("div", null, list.map(()=>true ? /*#__PURE__*/ React.createElement(SomeList, {
callback: ()=>console.log("do something")
}) : /*#__PURE__*/ React.createElement("div", null)
));
};