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: toString should stringify node #74

Merged
merged 4 commits into from Mar 7, 2019

Conversation

Projects
None yet
3 participants
@shellscape
Copy link
Owner

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.

@jwilsson
Copy link
Collaborator

jwilsson left a comment

LGTM

@shellscape shellscape requested review from jonathantneal and jwilsson Mar 7, 2019

@shellscape

This comment has been minimized.

Copy link
Owner Author

shellscape commented Mar 7, 2019

@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
Copy link
Collaborator

jonathantneal left a comment

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

Show resolved Hide resolved lib/index.js Outdated

@shellscape shellscape merged commit 3b10553 into master Mar 7, 2019

5 checks passed

ci/circleci: analysis Your tests passed on CircleCI!
Details
ci/circleci: dependency_cache Your tests passed on CircleCI!
Details
ci/circleci: node-v10-latest Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 93.24%)
Details
security/snyk - package.json (shellscape) No manifest changes detected

@shellscape shellscape deleted the fix/tostring branch Mar 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.