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

Refactor to replace style-search for functionArgumentsSearch() #5882

Merged
merged 1 commit into from Feb 7, 2022

Conversation

ybiquitous
Copy link
Member

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

Closes #5499
(I think this PR is the last one of #5499)

Is there anything in the PR that needs further explanation?

Replacing style-search with postcss-value-parser.

Replacing `style-search` with `postcss-value-parser`.
@@ -3,10 +3,17 @@
const functionArgumentsSearch = require('../functionArgumentsSearch');

it('passes function arguments to callback', () => {
expect.assertions(2);
Copy link
Member Author

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,
Copy link
Member Author

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.

@ybiquitous ybiquitous marked this pull request as ready for review February 6, 2022 22:46

it('passes function arguments to callback when a case with mutiple expressions', () => {
expect.assertions(2);

Copy link
Member Author

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.

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.

Nice. LGTM, thanks!

@ybiquitous ybiquitous merged commit 4b0f57d into main Feb 7, 2022
@ybiquitous ybiquitous deleted the refactor-functionArgumentsSearch branch February 7, 2022 08:46
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.

Refactor to remove style-search
2 participants