Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: toString should stringify node #74

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

Merged
shellscape merged 4 commits into master from fix/tostring
Mar 7, 2019
Merged

fix: toString should stringify node #74

shellscape merged 4 commits into master from fix/tostring
Mar 7, 2019

Conversation

@shellscape
Copy link
Owner

@shellscape shellscape commented Mar 6, 2019

This PR contains:

  • bugfix
  • feature
  • refactor
  • tests
  • documentation
  • metadata

Breaking Changes?

  • yes
  • no

If yes, please describe the breakage.

Please Describe Your Changes

Fixes #72. Using toString or String(node) is failing due to the base PostCSS stringifier not being able to recognize our node types.

This isn't as elegant as I'd like, and does involve some code duplication that I'm not a fan of, but it gets the job done for the time being.

Copy link
Collaborator

@jwilsson jwilsson left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Owner Author

@jonathantneal @jwilsson went back over the PR today and found that the tests for toString() weren't actually testing the node's toString - a copy/pasted typo was just checking a string against it's own toString.

That led me to refactor quite a bit, and revealed several subsequent shortcomings, all of which should now be fixed. I've improved the tests and coverage to guard against what I found moving forward. Please review again.

jonathantneal reacted with thumbs up emoji

Copy link
Collaborator

@jonathantneal jonathantneal left a comment

Choose a reason for hiding this comment

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

I left one question, but it is non-blocking. Looks good!

@shellscape shellscape merged commit 3b10553 into master Mar 7, 2019
@shellscape shellscape deleted the fix/tostring branch March 7, 2019 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jonathantneal jonathantneal jonathantneal approved these changes

@jwilsson jwilsson Awaiting requested review from jwilsson

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

String(node) should produce string or throw more helpful error

AltStyle によって変換されたページ (->オリジナル) /