You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported error: 13:7 error Unexpected function call in describe block mocha/no-setup-in-describe
It appears that the handling of CallExpression:exit on each of the omit secondary calls pops a function off the stack, so that by the time the parser reaches the assign, it thinks it's in the describe block.
I think a better process for this would be for the process to stash the call it encounters in the describe block. If it's an acceptable function (hook or test), then save that callee and skip everything until it reaches the exit of that call function. Managing a full stack is tricky and I think more work than we want.
The text was updated successfully, but these errors were encountered:
There was one call of `astUtils.isDescribe` which has been called
without the second parameter which caused the function to accept
`undefined` as a valid alias for suite function names. Additionally
there are cases where we don’t get a node name for `CallExpressions`
(e.g. `foo()()`). So in such cases the extracted node name is
`undefined` and `isDescribe` will return true due to the above mentioned
bug.
Fixes: #172
Code:
Reported error:
13:7 error Unexpected function call in describe block mocha/no-setup-in-describe
It appears that the handling of
CallExpression:exit
on each of theomit
secondary calls pops a function off the stack, so that by the time the parser reaches theassign
, it thinks it's in thedescribe
block.I think a better process for this would be for the process to stash the call it encounters in the describe block. If it's an acceptable function (hook or test), then save that callee and skip everything until it reaches the exit of that call function. Managing a full stack is tricky and I think more work than we want.
The text was updated successfully, but these errors were encountered: