diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-fbt-with-additional-whitespace-child.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-fbt-with-additional-whitespace-child.expect.md new file mode 100644 index 0000000000..4bfe9a4fea --- /dev/null +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-fbt-with-additional-whitespace-child.expect.md @@ -0,0 +1,31 @@ + +## Input + +```javascript +function Component(props) { + return ( + + + vote + {" "} + for {props.option} + + ); +} + +``` + + +## Error + +``` + 5 | vote + 6 | {" "} +> 7 | for {props.option} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ReactForget] Invariant: Expected fbt element to have 3 children (whitespace, content, whitespace) or 1 (content) (7:7) + 8 | + 9 | ); + 10 | } +``` + + \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-fbt-with-additional-whitespace-child.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-fbt-with-additional-whitespace-child.js new file mode 100644 index 0000000000..2624d1dae4 --- /dev/null +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-fbt-with-additional-whitespace-child.js @@ -0,0 +1,10 @@ +function Component(props) { + return ( + + + vote + {" "} + for {props.option} + + ); +}