Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(expect-expect): support MemberExpressions in assertFunctionNames #176

Merged
merged 1 commit into from
Oct 14, 2018

Conversation

macklinu
Copy link
Collaborator

Fixes #175

@@ -1,23 +1,7 @@
'use strict';

const getDocsUrl = require('./util').getDocsUrl;

function getName(node) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I replaced the implementation of util/getNodeName with this implementation, which I think handles member expressions a little bit better than the expect-expect implementation.

All tests continue to pass with the refactor too. 👍

if (index !== -1) {
unchecked.splice(index, 1);
break;
CallExpression(node) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using the selector query syntax became a little confusing now having to support MemberExpressions, so all CallExpression logic lives in this visitor function now. 😃

@macklinu macklinu force-pushed the fix/expect-expect-call-expression branch from 766272d to 2bb78f1 Compare October 13, 2018 23:18
@macklinu macklinu requested a review from SimenB October 13, 2018 23:18
@SimenB SimenB merged commit 9466959 into master Oct 14, 2018
@SimenB SimenB deleted the fix/expect-expect-call-expression branch October 14, 2018 10:42
@SimenB
Copy link
Member

SimenB commented Oct 14, 2018

🎉 This PR is included in version 21.24.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants