-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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 #925 - indentation is broken for debug() on shallow wrapper #926
Fix #925 - indentation is broken for debug() on shallow wrapper #926
Conversation
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.
Seems legit.
@ljharb Thanks for looking. I pushed an additional commit to skip these new tests on v0.13 where they were failing. |
test/Debug-spec.jsx
Outdated
}); | ||
}); | ||
|
||
describeIf(!REACT013, 'debugNodes', () => { |
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.
instead of skipping these tests on react 13, can we just not use an SFC?
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.
Ah, got it. Good idea, I can try that.
@ljharb updated |
@finnigantime please don't use the update branch button in Github's UI - this needs a rebase on the command line. |
2f57e62
to
dc34bc3
Compare
b24424f
to
21a5ebf
Compare
Should be squashed and rebased against the latest master commit now. |
The tests are failing due to npm v4.6 breaking on node < 1.0. I'll fix in master, after which you can rebase. |
@finnigantime k, if you rebase once more it should pass |
21a5ebf
to
f72cae6
Compare
@ljharb Thanks! Green build. G2G? |
SUMMARY
DETAILS
The problem is with the use of
.map()
:Array.map passes 3 args to the callback, the second of which is the current index (0 in this case since there's only one top-level node), which overrides the default arg value
indentLength = 2
in debugNode.The fix here adds a callback that explicitly only takes one parameter and then calls debugNode explicitly with that single parameter:
nodes.map(node => debugNode(node))