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
When jest/no-if is enabled, An if statement within () => { is caught no problem. But when it's inside function () {, it is not caught.
Example:
constcondition=truetest('arrow function with condition',()=>{letsum=0if(condition){// this fails jest/no-ifsum=1+2}expect(sum).toBe(3);});test('standard function with condition',function(){letsum=0if(condition){// this is not caught by jest/no-ifsum=1+2}expect(sum).toBe(3);});
When
jest/no-if
is enabled, An if statement within() => {
is caught no problem. But when it's insidefunction () {
, it is not caught.Example:
Reproducible Code
The text was updated successfully, but these errors were encountered: