[test] Add failing test for empty return in useMemo callback

This commit is contained in:
Sathya Gunasekaran
2023-04-17 21:11:42 +01:00
parent 00d4a69459
commit 0e34c39c58
2 changed files with 29 additions and 0 deletions
@@ -0,0 +1,22 @@
## Input
```javascript
// @inlineUseMemo
function component(a) {
let x = useMemo(() => {
mutate(a);
}, []);
return x;
}
```
## Error
```
Expected value for identifier `9` to be initialized.
```
@@ -0,0 +1,7 @@
// @inlineUseMemo
function component(a) {
let x = useMemo(() => {
mutate(a);
}, []);
return x;
}