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
Refactor to replace style-search
for functionArgumentsSearch()
#5882
Conversation
Replacing `style-search` with `postcss-value-parser`.
@@ -3,10 +3,17 @@ | |||
const functionArgumentsSearch = require('../functionArgumentsSearch'); | |||
|
|||
it('passes function arguments to callback', () => { | |||
expect.assertions(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[note] Added expect.assertions()
to ensure assertions executed in the callback.
@@ -63,7 +63,7 @@ const rule = (primary) => { | |||
|
|||
functionArgumentsSearch( | |||
valueParser.stringify(valueNode).toLowerCase(), | |||
'linear-gradient', | |||
/^(-webkit-|-moz-|-o-)?linear-gradient$/i, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[note] postcss-value-parser
doesn't seem to support the fuzzy match. Instead, using regex.
|
||
it('passes function arguments to callback when a case with mutiple expressions', () => { | ||
expect.assertions(2); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[note] Splitted into smaller test cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. LGTM, thanks!
Closes #5499
(I think this PR is the last one of #5499)
Replacing
style-search
withpostcss-value-parser
.