Skip to content

[valid-expect-in-promise] Doesn't work with Promise.finally #740

@mq2thez

Description

@mq2thez

Looks like a similar issue was referenced here: #219. In our case, expect in a finally without a return does not cause an ESLint issue.

    describe("making a network call", () => {
        it("Makes the correct call", () => {
            const mySpy = jest.fn();
            const callMySpyAsync = () => Promise.resolve().then(() => mySpy(5678));
            callMySpyAsync(1234).finally(() => {
                expect(mySpy).toHaveBeenCalledWith(1234);
            });
        });
    });

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions