Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix isStandardSyntaxTypeSelector.test.js that use callbacks #4990

Merged
merged 1 commit into from Nov 17, 2020

Conversation

ybiquitous
Copy link
Member

Which issue, if any, is this issue related to?

This is a part of #4881.

Is there anything in the PR that needs further explanation?

I disable some test cases due to failure as follows:

● isStandardSyntaxTypeSelector › shadow-piercing descendant combinator

  TypeError: Cannot read property 'parent' of undefined

    14 | 	// The fake-tag's "parent" is actually a selector node, whose parent
    15 | 	// should be the :nth-child pseudo node.
  > 16 | 	if (!node.parent || !node.parent.parent) {
       | 	          ^
    17 | 		return false;
    18 | 	}
    19 |

    at isStandardSyntaxTypeSelector (lib/utils/isStandardSyntaxTypeSelector.js:16:12)
    at Object.<anonymous> (lib/utils/__tests__/isStandardSyntaxTypeSelector.test.js:49:10)

The cause seems due to postcss-selector-parser has not supported Reference Combinator, but I don't know the details. 🤷
(maybe #2508 related?)

@ybiquitous
Copy link
Member Author

ybiquitous commented Oct 16, 2020

Not covered by the test:

// Reference combinators like `/deep/`
if (node.value.startsWith('/') && node.value.endsWith('/')) {
return false;
}

image

https://coveralls.io/builds/34214757/source?filename=lib/utils/isStandardSyntaxTypeSelector.js#L49

@ybiquitous ybiquitous marked this pull request as ready for review October 16, 2020 13:38
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Let's pick up the missing coverage and funkiness around reference combinators in other pull requests.

@jeddy3 jeddy3 merged commit 2db70e9 into master Nov 17, 2020
@jeddy3 jeddy3 deleted the fix-isStandardSyntaxTypeSelector.test.js branch November 17, 2020 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants