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 disableRanges.test.js that uses callbacks #4991

Merged
merged 1 commit into from Nov 17, 2020

Conversation

ybiquitous
Copy link
Member

@ybiquitous ybiquitous commented Oct 16, 2020

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?

This change uses async/await a lot to avoid callbacks.

Also, it uses .rejects of Jest to test thrown errors, instead of throw/catch.

Besides, it uses template literals a lot for the readability of multi-line CSS code.


Recommended splitted diff view: https://github.com/stylelint/stylelint/pull/4991/files?diff=split&w=1

This change uses `async/await` a lot to avoid callbacks.

Also, it uses `.rejects` of Jest to test thrown erros, instead of `throw/catch`.
(see <https://jestjs.io/docs/en/tutorial-async.html#rejects>)
@ybiquitous ybiquitous marked this pull request as ready for review October 16, 2020 15:14
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.

@ybiquitous Many thanks! This is much cleaner.

@jeddy3 jeddy3 merged commit da381ee into master Nov 17, 2020
@jeddy3 jeddy3 deleted the fix-disableRanges.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