Running Jest tests I got "The body of the arrow function supplied to `idx` must be a single expression"
See original GitHub issueThe body of the arrow function supplied to `idx` must be a single expression (without curly braces).
36 | })
37 | .then(res => {
> 38 | const similarItems = idx(res, _ => _.data.similarDeals) || [];
| ^
39 | if (similarItems.length) {
40 |
41 | const converted = similarItems.map(item => {
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Jest error running a file with idx operator - react native
The body of the arrow function supplied to `idx` must be a single expression (without curly braces). We make use of yarn and...
Read more >ES6 Class Mocks - Jest
If you use arrow functions in your classes, they will not be part of the mock. The reason for that is that arrow...
Read more >Fullstack React - dashboard
for running React apps), writing automated unit tests, and building a ... write a function body that is only a single line (or...
Read more >Groovy Language Documentation
Usage of generic classes and methods, regardless of whether they are defined in Java or Groovy, may involve supplying a type argument.
Read more >Exploring Array Some in JavaScript - Ultimate Courses
If one element passes then Array Some returns true . ... Inside the body of the function we need to return an expression...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is there anyway to work this around? I had the issue above a long time running, I thought to maybe implement a function identical to idx locally rather using the babel plugin.
Interesting! I wonder if a coverage plugin is injecting extra AST nodes into the arrow function.
Thanks for that insight. I’ll need to brainstorm with @cpojer about how to best proceed.