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
For some reason I didn't seem to get a notification about this, but totally for the second one we should be erroring.
For the function however, I think we shouldn't (which is the current behaviour if you use an if).
This is because there are valid reasons to use a conditional in an it, such as in mocking:
listUsersMock.mockImplementation(async param => {
const i = +(param.Marker ?? 0);
const next = i + 1;
return Promise.resolve({
Users: [mockUsers[i]],
Marker: mockUsers.length === next ? undefined : next.toString()
});
});
Thats taken from an active project of mine - while I do have that in a beforeEach, it's perfectly valid to have in the actual test method; Arguably you shouldn't due to the extra complexity, but that's not what no-if is linting.
just discovered that if a ternary is nested inside a function call it will not be reported:
a couple examples of things that are not reporting:
The text was updated successfully, but these errors were encountered: