diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-switch-with-only-default.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-switch-with-only-default.expect.md new file mode 100644 index 0000000000..a0c950647b --- /dev/null +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-switch-with-only-default.expect.md @@ -0,0 +1,21 @@ + +## Input + +```javascript +function Component({ kind, ...props }) { + switch (kind) { + default: + return ; + } +} + +``` + + +## Error + +``` +[ReactForget] Invariant: Expected trees to be at least 2 elements long. +``` + + \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-switch-with-only-default.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-switch-with-only-default.js new file mode 100644 index 0000000000..4b6cc8b258 --- /dev/null +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-switch-with-only-default.js @@ -0,0 +1,6 @@ +function Component({ kind, ...props }) { + switch (kind) { + default: + return ; + } +}