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
it("handles an error",async()=>{constp=Promise.reject(newError("test error")).then(undefined,(e)=>{expect(e).toBeInstanceOf(Error);return"handled";});expect(awaitp).toBe("handled");});
produces the error
This promise should either be returned or awaited to ensure the expects in it's chain are called jest/valid-expect-in-promise
The promise is being awaited so the lint rule should not error.
Versions:
"eslint": "7.32.0"
"eslint-plugin-jest": "25.0.1"
Node 14.17.6
The text was updated successfully, but these errors were encountered:
Currently we're looking straight up for either a return or an await in the function body, but we should also check (somehow 🤔) if the promise is being awaited as a parameter to a function call that is within the test functions body
Minimal repro
This code
produces the error
The promise is being awaited so the lint rule should not error.
Versions:
The text was updated successfully, but these errors were encountered: