Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Fix middleware thunk test #643

Merged
merged 1 commit into from Jun 21, 2020
Merged

Conversation

danielrearden
Copy link
Collaborator

No description provided.

hasResponse = true;
}
hasRequest = Boolean(req);
hasResponse = Boolean(res);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't really like such conversions.
You can do:

let seenRequest;

// ...
seenRequest = req;

// ...
expect(seenRequest) // ...
// Not sure how to use chai to check if it's requested, AFAIK it should be an instance of some class.

@IvanGoncharov
Copy link
Member

@danielrearden You doing this to increase coverage?

@danielrearden
Copy link
Collaborator Author

@IvanGoncharov This fixes the issue we discussed here. ESLint will complain about an unnecessary condition because the type indicates that req and res should always be defined.

By the way, as far as I can tell, istanbul is wrong -- the "else" branch is never actually hit.

@IvanGoncharov
Copy link
Member

@danielrearden Thanks for the detailed explanation 👍

@IvanGoncharov IvanGoncharov merged commit 194b842 into graphql:master Jun 21, 2020
@danielrearden danielrearden deleted the fix-test2 branch June 21, 2020 10:20
@IvanGoncharov IvanGoncharov added the PR: polish 💅 PR doesn't change public API or any observed behaviour label Jun 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR: polish 💅 PR doesn't change public API or any observed behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants